Skip to content

Commit

Permalink
Fixes #13
Browse files Browse the repository at this point in the history
  • Loading branch information
gbiggs committed Jan 26, 2015
1 parent 3f9f6e8 commit 2230e6a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pykg_config/pkgsearcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,17 +231,19 @@ def _init_search_dirs(self):
num_subkeys, num_vals, modified = _winreg.QueryInfoKey(key)
for ii in range(num_vals):
name, val, type = _winreg.EnumValue(key, ii)
if type == _winreg.REG_SZ:
if type == _winreg.REG_SZ and isdir(val):
self._append_packages(val)
except WindowsError as e:
ErrorPrinter().debug_print('Failed to add paths from \
{0}\\{1}: {2}'.format(root[1], key_path, e))
finally:
_winreg.CloseKey(key)
# Default path: If a hard-coded path has been set, use that
# Default path: If a hard-coded path has been set, use that (excluding
# paths that don't exist)
if pc_path:
for d in pc_path.split(self._split_char()):
self._append_packages(d)
if d and isdir(d):
self._append_packages(d)
# Default path: Else append prefix/lib/pkgconfig, prefix/share/pkgconfig
else:
if Options().get_option('is_64bit'):
Expand Down

0 comments on commit 2230e6a

Please sign in to comment.