fabioz / PyDev.Debugger

Sources for the debugger used in PyDev, PyCharm and VSCode Python
Eclipse Public License 1.0
425 stars 122 forks source link

Error while running the PyDev,debugger #31

Closed abhiramkulkarni closed 8 years ago

abhiramkulkarni commented 9 years ago

When i was trying to debug my python code with the help of this debugger, i hit the below exception

/usr/bin/python2.7 /home/Abhiram86/software/pycharm/pycharm-community-4.5.1/helpers/pydev/pydevd.py --multiproc --client 127.0.0.1 --port 58765 --file /home/Abhiram86/PycharmProjects/kimchi/src/kimchid.py Traceback (most recent call last): File "/home/Abhiram86/software/pycharm/pycharm-community-4.5.1/helpers/pydev/pydevd.py", line 7, in pydev_monkey_qt.patch_qt() File "/home/Abhiram86/software/pycharm/pycharm-community-4.5.1/helpers/pydev/pydev_monkey_qt.py", line 47, in patch_qt _patch_import_to_patch_pyqt_on_import(patch_qt_on_import) File "/home/Abhiram86/software/pycharm/pycharm-community-4.5.1/helpers/pydev/pydev_monkey_qt.py", line 77, in _patch_import_to_patch_pyqt_on_import builtins.import = patched_import UnboundLocalError: local variable 'builtins' referenced before assignment

Process finished with exit code 1

When i changed the code in pydev_monkey_qt.patch_qt() from

try:
    import builtins
except ImportError:
    import __builtin__ as builtins
builtins.__import__ = patched_import   

to

try:
    import builtins
except ImportError:
    import __builtin__ as builtins
    builtins.__import__ = patched_import

all works fine

fabioz commented 8 years ago

Do you still have that error with the latest version?