Explorar o código

Merge pull request #837 from stevenjt/python3-xrange-fix

Python 3 compatibility fix for xrange in PyAssimp
Kim Kulling %!s(int64=9) %!d(string=hai) anos
pai
achega
1d8dba13d5
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      port/PyAssimp/pyassimp/core.py

+ 5 - 0
port/PyAssimp/pyassimp/core.py

@@ -8,6 +8,11 @@ import sys
 if sys.version_info < (2,6):
     raise 'pyassimp: need python 2.6 or newer'
 
+# xrange was renamed range in Python 3 and the original range from Python 2 was removed.
+# To keep compatibility with both Python 2 and 3, xrange is set to range for version 3.0 and up.
+if sys.version_info >= (3,0):
+    xrange = range
+
 import ctypes
 import os