diff options
| author | Stefan Behnel <stefan_ml@behnel.de> | 2018-10-30 20:17:36 +0100 |
|---|---|---|
| committer | Stefan Behnel <stefan_ml@behnel.de> | 2018-10-30 20:21:07 +0100 |
| commit | da657c8e326a419cde8ae6ea91be9661b9622504 (patch) | |
| tree | e08e8eb50715df9f2a3cbbad008ad8c91bd17a95 /Cython/Compiler | |
| parent | 5fdbfe49d56d756169e75c80c126eee5fc8fad52 (diff) | |
| download | cython-gh2692_remove_py26_support.tar.gz | |
Remove support for Py2.6 and various quirks that special-cased it.gh2692_remove_py26_support
Closes #2692.
Diffstat (limited to 'Cython/Compiler')
| -rw-r--r-- | Cython/Compiler/Code.py | 6 | ||||
| -rw-r--r-- | Cython/Compiler/Errors.py | 4 | ||||
| -rw-r--r-- | Cython/Compiler/Main.py | 4 | ||||
| -rw-r--r-- | Cython/Compiler/ModuleNode.py | 4 |
4 files changed, 4 insertions, 14 deletions
diff --git a/Cython/Compiler/Code.py b/Cython/Compiler/Code.py index 232b0406e..e7ccdc5ae 100644 --- a/Cython/Compiler/Code.py +++ b/Cython/Compiler/Code.py @@ -43,8 +43,6 @@ try: except ImportError: from builtins import str as basestring -KEYWORDS_MUST_BE_BYTES = sys.version_info < (2, 7) - non_portable_builtins_map = { # builtins that have different names in different Python versions @@ -259,15 +257,11 @@ class UtilityCodeBase(object): utility[1] = code else: all_tags = utility[2] - if KEYWORDS_MUST_BE_BYTES: - type = type.encode('ASCII') all_tags[type] = code if tags: all_tags = utility[2] for name, values in tags.items(): - if KEYWORDS_MUST_BE_BYTES: - name = name.encode('ASCII') all_tags.setdefault(name, set()).update(values) @classmethod diff --git a/Cython/Compiler/Errors.py b/Cython/Compiler/Errors.py index 9761b52c3..4aa0e903c 100644 --- a/Cython/Compiler/Errors.py +++ b/Cython/Compiler/Errors.py @@ -60,8 +60,6 @@ class CompileError(PyrexError): self.message_only = message self.formatted_message = format_error(message, position) self.reported = False - # Deprecated and withdrawn in 2.6: - # self.message = message Exception.__init__(self, self.formatted_message) # Python Exception subclass pickling is broken, # see http://bugs.python.org/issue1692335 @@ -74,8 +72,6 @@ class CompileWarning(PyrexWarning): def __init__(self, position = None, message = ""): self.position = position - # Deprecated and withdrawn in 2.6: - # self.message = message Exception.__init__(self, format_position(position) + message) class InternalError(Exception): diff --git a/Cython/Compiler/Main.py b/Cython/Compiler/Main.py index 0f1ff4d33..9465edab3 100644 --- a/Cython/Compiler/Main.py +++ b/Cython/Compiler/Main.py @@ -9,8 +9,8 @@ import re import sys import io -if sys.version_info[:2] < (2, 6) or (3, 0) <= sys.version_info[:2] < (3, 3): - sys.stderr.write("Sorry, Cython requires Python 2.6+ or 3.3+, found %d.%d\n" % tuple(sys.version_info[:2])) +if sys.version_info[:2] < (2, 7) or (3, 0) <= sys.version_info[:2] < (3, 3): + sys.stderr.write("Sorry, Cython requires Python 2.7 or 3.3+, found %d.%d\n" % tuple(sys.version_info[:2])) sys.exit(1) try: diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index ce1a94289..c256ef883 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -635,9 +635,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln("#ifndef Py_PYTHON_H") code.putln(" #error Python headers needed to compile C extensions, " "please install development version of Python.") - code.putln("#elif PY_VERSION_HEX < 0x02060000 || " + code.putln("#elif PY_VERSION_HEX < 0x02070000 || " "(0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)") - code.putln(" #error Cython requires Python 2.6+ or Python 3.3+.") + code.putln(" #error Cython requires Python 2.7+ or Python 3.3+.") code.putln("#else") code.globalstate["end"].putln("#endif /* Py_PYTHON_H */") |
