Skip to content

Commit

Permalink
Merge pull request #124 from LanceMaverick/fix-issue-duplicate-command
Browse files Browse the repository at this point in the history
Fixes double import for beards, Fixes #123.
  • Loading branch information
LanceMaverick committed Mar 24, 2017
2 parents 7a38896 + 172f1ed commit eb756fd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion skybeard/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,16 @@ def setup_beard(beard_module_name,
# module is reloaded to ensure that if a module is found in
# beard_python_path called beard_module_name, *that* module is loaded.
mod = importlib.import_module(beard_module_name)
importlib.reload(mod)
# If it's a namespace module, then it hasn't yet imported the new
# module. Reload to get the new one.
if is_namespace_module(mod):
importlib.reload(mod)


def is_namespace_module(mod):
"""Check is the given module is a namespace module."""
return not hasattr(mod, '__file__')

def get_literal_path(path_or_autoloader):
"""Gets literal path from AutoLoader or returns input."""

Expand Down

0 comments on commit eb756fd

Please sign in to comment.