Permalink
Browse files

Support Cython under pdb for python 2.4

  • Loading branch information...
1 parent 6640e99 commit f9b33c46b9d238654e5ac375fd0e3a2e53bde60c @markflorisson committed Oct 14, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 cython.py
View
@@ -8,10 +8,14 @@
import os
import sys
-
- # Make sure we import the right Cython
- cythonpath, _ = os.path.split(os.path.realpath(__file__))
- sys.path.insert(0, cythonpath)
+
+ try:
+ # Make sure we import the right Cython
+ cythonpath, _ = os.path.split(os.path.realpath(__file__))
+ sys.path.insert(0, cythonpath)
+ except NameError:
+ # In pdb in python 2.4, __file__ is not defined...
+ pass
from Cython.Compiler.Main import main
main(command_line = 1)

0 comments on commit f9b33c4

Please sign in to comment.