DebugClients/Python/DebugBase.py

changeset 5700
3bcd20e99b52
parent 5684
a46555ca12bc
child 5717
b7dd23b4e728
--- a/DebugClients/Python/DebugBase.py	Mon Apr 10 21:23:54 2017 +0200
+++ b/DebugClients/Python/DebugBase.py	Mon Apr 10 21:40:17 2017 +0200
@@ -578,22 +578,22 @@
         """
         # get module name from __file__
         fn = frame.f_globals.get('__file__')
-        if fn is not None:
-            try:
-                return self._fnCache[fn]
-            except KeyError:
-                absFilename = os.path.abspath(fn)
-                if absFilename.endswith(('.pyc', '.pyo')):
-                    fixedName = absFilename[:-1]
-                    if not os.path.exists(fixedName):
-                        fixedName = absFilename
-                else:
+        try:
+            return self._fnCache[fn]
+        except KeyError:
+            if fn is None:
+                return frame.f_code.co_filename
+            
+            absFilename = os.path.abspath(fn)
+            if absFilename.endswith(('.pyc', '.pyo')):
+                fixedName = absFilename[:-1]
+                if not os.path.exists(fixedName):
                     fixedName = absFilename
-                # update cache
-                self._fnCache[fn] = fixedName
-                return fixedName
-        else:
-            return frame.f_code.co_filename
+            else:
+                fixedName = absFilename
+            # update cache
+            self._fnCache[fn] = fixedName
+            return fixedName
 
     def __checkBreakInFrame(self, frame):
         """

eric ide

mercurial