Issue2499
Created on 2016-05-11.16:36:37 by zyasoft, last changed 2018-03-22.08:49:14 by jeff.allen.
msg10856 (view) |
Author: Jim Baker (zyasoft) |
Date: 2016-05-11.16:36:36 |
|
As seen in this hacky workaround for the lazy_reload package (https://github.com/boostpro/lazy_reload):
def is_submodule_name( name, root_name ):
try:
return (name + '.').startswith(root_name + '.')
except:
return (name + '.').startswith(root_name.__name__ + '.')
|
msg10857 (view) |
Author: Jim Baker (zyasoft) |
Date: 2016-05-11.16:37:42 |
|
Here's the actual diff for the hacky workaround:
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):
"""
|
msg11737 (view) |
Author: Jeff Allen (jeff.allen) |
Date: 2018-03-03.14:34:31 |
|
I suggest only when CPython does the same thing.
>>> "hello " + pdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Can't convert 'module' object to str implicitly
|
|
Date |
User |
Action |
Args |
2018-03-22 08:49:14 | jeff.allen | set | priority: low milestone: Jython 2.7.2 -> |
2018-03-03 14:34:31 | jeff.allen | set | nosy:
+ jeff.allen messages:
+ msg11737 |
2016-05-11 16:37:42 | zyasoft | set | messages:
+ msg10857 |
2016-05-11 16:36:37 | zyasoft | create | |
|