123 versionExt = '.py2' |
123 versionExt = '.py2' |
124 else: |
124 else: |
125 versionExt = '.py3' |
125 versionExt = '.py3' |
126 |
126 |
127 # get module name from __file__ |
127 # get module name from __file__ |
128 if not isinstance(frame, profile.Profile.fake_frame) and \ |
128 if (not isinstance(frame, profile.Profile.fake_frame) and |
129 '__file__' in frame.f_globals: |
129 '__file__' in frame.f_globals): |
130 root, ext = os.path.splitext(frame.f_globals['__file__']) |
130 root, ext = os.path.splitext(frame.f_globals['__file__']) |
131 if ext in ['.pyc', '.py', versionExt, '.pyo']: |
131 if ext in ['.pyc', '.py', versionExt, '.pyo']: |
132 fixedName = root + '.py' |
132 fixedName = root + '.py' |
133 if os.path.exists(fixedName): |
133 if os.path.exists(fixedName): |
134 return fixedName |
134 return fixedName |