Browse Source

Implement next() for Python 2.5

Matthew Wang 11 years ago
parent
commit
12efc9d2c7
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      cdiff.py

+ 6
- 0
cdiff.py View File

23
 if sys.hexversion < 0x02050000:
23
 if sys.hexversion < 0x02050000:
24
     raise SystemExit("*** Requires python >= 2.5.0")    # pragma: no cover
24
     raise SystemExit("*** Requires python >= 2.5.0")    # pragma: no cover
25
 
25
 
26
+# Python < 2.6 does not have next()
27
+try:
28
+    next
29
+except NameError:
30
+    def next(obj): return obj.next()
31
+
26
 import re
32
 import re
27
 import signal
33
 import signal
28
 import subprocess
34
 import subprocess