Skip to content

Commit

Permalink
Wannabe fix for systems not loading python packages from local path
Browse files Browse the repository at this point in the history
  • Loading branch information
amol- committed Mar 10, 2014
1 parent 543688f commit 81390e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gearbox/main.py
Expand Up @@ -15,6 +15,9 @@ def __init__(self):
version='2.3',
command_manager=CommandManager('gearbox.commands'))

def initialize_app(self, args):
sys.path.insert(0, os.getcwd())

try:
self._load_commands_for_current_dir()
except pkg_resources.DistributionNotFound as e:
Expand Down Expand Up @@ -57,7 +60,7 @@ def _load_commands_for_current_dir(self):
try:
pkg_resources.require(package_name)
except pkg_resources.DistributionNotFound as e:
msg = '%sNot Found%s: %s (did you run python setup.py develop?)'
msg = '%sNot Found%s: %s (is it an installed Distribution?)'
if str(e) != package_name:
raise pkg_resources.DistributionNotFound(msg % (str(e) + ': ', ' for', package_name))
else:
Expand Down

0 comments on commit 81390e9

Please sign in to comment.