Fixed .egg debugging for python 2.7

This commit is contained in:
Dmitry Trofimov
2012-12-13 16:45:28 +01:00
parent da7dfc191d
commit 8bd83aa64b
2 changed files with 9 additions and 1 deletions

View File

@@ -584,7 +584,10 @@ class NetCommandFactory:
#print "name is ", myName
myFile = pydevd_file_utils.NormFileToClient(curFrame.f_code.co_filename)
filename, base = pydevd_file_utils.GetFilenameAndBase(curFrame)
myFile = pydevd_file_utils.NormFileToClient(filename)
#print "file is ", myFile
#myFile = inspect.getsourcefile(curFrame) or inspect.getfile(frame)

View File

@@ -292,6 +292,11 @@ def GetFileNameAndBaseFromFile(f):
def GetFilenameAndBase(frame):
#This one is just internal (so, does not need any kind of client-server translation)
f = frame.f_code.co_filename
if f is not None and f.startswith('build/bdist.'):
# files from eggs in Python 2.7 have paths like build/bdist.linux-x86_64/egg/<path-inside-egg>
f = frame.f_globals['__file__']
if f.endswith('.pyc'):
f = f[:-1]
return GetFileNameAndBaseFromFile(f)
def set_pycharm_os(os):