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):
sys.stderr.write("Sorry, Cython requires Python 2.6+ or 3.2+, found %d.%d\n" % tuple(sys.version_info[:2]))
sys.exit(1)
try:
from __builtin__ import basestring
except ImportError:
basestring = str
from . import Errors
# Do not import Parsing here, import it when needed, because Parsing imports
# Nodes, which globally needs debug command line options initialized to set a
......
......@@ -15,6 +15,11 @@ from distutils import log
from distutils.command import build_ext as _build_ext
from distutils import sysconfig
try:
from __builtin__ import basestring
except ImportError:
basestring = str
extension_name_re = _build_ext.extension_name_re
show_compilers = _build_ext.show_compilers
......
# cython.* namespace for pure mode.
from __future__ import absolute_import
__version__ = "0.23.beta1"
try:
from __builtin__ import basestring
except ImportError:
basestring = str
# BEGIN shameless copy from Cython/minivect/minitypes.py
......
......@@ -3,6 +3,13 @@
# anywhere else in particular
#
from __future__ import absolute_import
try:
from __builtin__ import basestring
except ImportError:
basestring = str
import os
import sys
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