summaryrefslogtreecommitdiff
path: root/src/lxml/includes
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2014-03-10 20:32:54 +0100
committerStefan Behnel <stefan_ml@behnel.de>2014-03-10 20:32:54 +0100
commitea5bb99ebf6eb197f32e41a99f5a7333907c57ff (patch)
treea94eb5feda135e541b833a0531933c329beb2269 /src/lxml/includes
parentc464b866b12169358b699b7c9a1c943170d1afe0 (diff)
downloadpython-lxml-ea5bb99ebf6eb197f32e41a99f5a7333907c57ff.tar.gz
remove some legacy code
Diffstat (limited to 'src/lxml/includes')
-rw-r--r--src/lxml/includes/etree_defs.h22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/lxml/includes/etree_defs.h b/src/lxml/includes/etree_defs.h
index 483493e8..eb221437 100644
--- a/src/lxml/includes/etree_defs.h
+++ b/src/lxml/includes/etree_defs.h
@@ -30,7 +30,7 @@
# define IS_PYPY 0
#endif
-#if PY_VERSION_HEX >= 0x03000000
+#if PY_MAJOR_VERSION >= 3
# define IS_PYTHON3 1
#else
# define IS_PYTHON3 0
@@ -49,15 +49,15 @@
# define PyWeakref_LockObject(obj) (NULL)
#endif
-/* Threading can crash under Python <= 2.4.1 and is not currently supported by PyPy */
-#if PY_VERSION_HEX < 0x02040200 || IS_PYPY
+/* Threading is not currently supported by PyPy */
+#if IS_PYPY
# ifndef WITHOUT_THREADING
# define WITHOUT_THREADING
# endif
#endif
/* Python 3 doesn't have PyFile_*() anymore */
-#if PY_VERSION_HEX >= 0x03000000
+#if PY_MAJOR_VERSION >= 3
# define PyFile_AsFile(o) (NULL)
#else
#if IS_PYPY
@@ -65,20 +65,6 @@
# define PyFile_AsFile(o) (NULL)
# undef PyUnicode_FromFormat
# define PyUnicode_FromFormat(s, a, b) (NULL)
-#else
-#if PY_VERSION_HEX < 0x02060000
-/* Cython defines these already, but we may not be compiling in Cython code */
-#ifndef PyBytes_CheckExact
-# define PyBytes_CheckExact(o) PyString_CheckExact(o)
-# define PyBytes_Check(o) PyString_Check(o)
-# define PyBytes_FromStringAndSize(s, len) PyString_FromStringAndSize(s, len)
-# define PyBytes_FromFormat PyString_FromFormat
-# define PyBytes_GET_SIZE(s) PyString_GET_SIZE(s)
-# define PyBytes_AS_STRING(s) PyString_AS_STRING(s)
-#endif
-/* we currently only use three parameters - MSVC can't compile (s, ...) */
-# define PyUnicode_FromFormat(s, a, b) (NULL)
-#endif
#endif
#endif