1. stephan preeker
  2. gevent

Commits

Ralf Schmitt  committed 3fcc5b9

make cython_ifdef.py work on python 2.5

the builtin bin is not available on python 2.5, so don't use it in the
_bin function.

  • Participants
  • Parent commits eb42a62
  • Branches default

Comments (0)

Files changed (1)

File util/cython_ifdef.py

View file
  • Ignore whitespace
 
 
 def _bin(number, length):
-    result = bin(number)[2:]
-    return '0' * (length - len(result)) + result
+    return "".join([str((number >> shift) & 1) for shift in xrange(length - 1, -1, -1)])
 
 
 def iter_configurations(symbols):