Browse Source

Implement next() for Python 2.5

Matthew Wang 10 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,6 +23,12 @@ import sys
23 23
 if sys.hexversion < 0x02050000:
24 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 32
 import re
27 33
 import signal
28 34
 import subprocess