Commit fd4ba3c5 authored by Stefan Behnel's avatar Stefan Behnel

make 'basestring' usages compatible with Py2/Py3

parent 4c2b18da
...@@ -13,6 +13,11 @@ if sys.version_info[:2] < (2, 6) or (3, 0) <= sys.version_info[:2] < (3, 2): ...@@ -13,6 +13,11 @@ if sys.version_info[:2] < (2, 6) or (3, 0) <= sys.version_info[:2] < (3, 2):
sys.stderr.write("Sorry, Cython requires Python 2.6+ or 3.2+, found %d.%d\n" % tuple(sys.version_info[:2])) sys.stderr.write("Sorry, Cython requires Python 2.6+ or 3.2+, found %d.%d\n" % tuple(sys.version_info[:2]))
sys.exit(1) sys.exit(1)
try:
from __builtin__ import basestring
except ImportError:
basestring = str
from . import Errors from . import Errors
# Do not import Parsing here, import it when needed, because Parsing imports # Do not import Parsing here, import it when needed, because Parsing imports
# Nodes, which globally needs debug command line options initialized to set a # Nodes, which globally needs debug command line options initialized to set a
......
...@@ -15,6 +15,11 @@ from distutils import log ...@@ -15,6 +15,11 @@ from distutils import log
from distutils.command import build_ext as _build_ext from distutils.command import build_ext as _build_ext
from distutils import sysconfig from distutils import sysconfig
try:
from __builtin__ import basestring
except ImportError:
basestring = str
extension_name_re = _build_ext.extension_name_re extension_name_re = _build_ext.extension_name_re
show_compilers = _build_ext.show_compilers show_compilers = _build_ext.show_compilers
......
# cython.* namespace for pure mode. # cython.* namespace for pure mode.
from __future__ import absolute_import
__version__ = "0.23.beta1" __version__ = "0.23.beta1"
try:
from __builtin__ import basestring
except ImportError:
basestring = str
# BEGIN shameless copy from Cython/minivect/minitypes.py # BEGIN shameless copy from Cython/minivect/minitypes.py
......
...@@ -3,6 +3,13 @@ ...@@ -3,6 +3,13 @@
# anywhere else in particular # anywhere else in particular
# #
from __future__ import absolute_import
try:
from __builtin__ import basestring
except ImportError:
basestring = str
import os import os
import sys import sys
import re import re
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment