fix PY-14582 Debug unidecode package
authorElizaveta Shashkova <Elizaveta.Shashkova@jetbrains.com>
Mon, 1 Dec 2014 12:11:03 +0000 (15:11 +0300)
committerElizaveta Shashkova <Elizaveta.Shashkova@jetbrains.com>
Mon, 1 Dec 2014 12:11:03 +0000 (15:11 +0300)
python/helpers/pydev/_pydev_imps/_pydev_pluginbase.py

index ed4203fb6f89f52892516c8bd59d074cff075348..f3c0a5fd533be92d83eb16e584df0a161136e920 100644 (file)
@@ -96,7 +96,11 @@ def _discover_space(name, globals):
     if '__pluginbase_state__' in globals:
         return globals['__pluginbase_state__'].source
 
-    mod_name = globals.get('__name__')
+    mod_name = None
+    if globals:
+        # in unidecode package they pass [] as globals arg
+        mod_name = globals.get('__name__')
+
     if mod_name is not None and \
        mod_name.startswith(_internalspace.__name__ + '.'):
         end = mod_name.find('.', len(_internalspace.__name__) + 1)