Issue2499

classification
Title: Modules should have implicit conversion to string when concatenated with a string
Type: Severity: normal
Components: Core Versions: Jython 2.7
Milestone: Jython 2.7.2
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: zyasoft
Priority: Keywords:

Created on 2016-05-11.16:36:37 by zyasoft, last changed 2016-05-11.16:37:42 by zyasoft.

Messages
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):
     """
History
Date User Action Args
2016-05-11 16:37:42zyasoftsetmessages: + msg10857
2016-05-11 16:36:37zyasoftcreate