Commits

Anonymous committed b4c1478

hgtk: support debugging with pdb.py

Comments (0)

Files changed (1)

         try:
             # assuming TortoiseHg source layout, with hgtk in contrib
             path = os.path.dirname(os.path.realpath(__file__))
-            norm = os.path.normpath(os.path.join(path, '..'))
-            if norm not in sys.path:
-                sys.path.append(norm)
-        except NameError: # __file__ is not always available
-            pass
+        except NameError:
+            # __file__ not available in pdb mode
+            path = os.path.dirname(sys.argv[0])
+        norm = os.path.normpath(os.path.join(path, '..'))
+        if norm not in sys.path:
+            sys.path.append(norm)
 
     try:
         from hggtk import hglib