Skip to content

Instantly share code, notes, and snippets.

@jimbaker
Created May 11, 2016 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimbaker/bed895b6f4ef167b95cebedaff9b6699 to your computer and use it in GitHub Desktop.
Save jimbaker/bed895b6f4ef167b95cebedaff9b6699 to your computer and use it in GitHub Desktop.
Workaround for lazy_reload module on Jython; see https://github.com/boostpro/lazy_reload
diff --git a/lazy_reload.py b/lazy_reload.py
index 566521e..1694775 100644
--- a/lazy_reload.py
+++ b/lazy_reload.py
@@ -40,7 +40,10 @@ else:
modules_to_reload = {}
def is_submodule_name( name, root_name ):
- return (name + '.').startswith(root_name + '.')
+ try:
+ return (name + '.').startswith(root_name + '.')
+ except:
+ return (name + '.').startswith(root_name.__name__ + '.')
def lazy_reload(root_module):
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment