diff --git a/Lib/python/pybuffer.i b/Lib/python/pybuffer.i index 3dc4c2121..5acbb0aa4 100644 --- a/Lib/python/pybuffer.i +++ b/Lib/python/pybuffer.i @@ -1,4 +1,4 @@ -/* Impelementing buffer protocol typemaps */ +/* Implementing buffer protocol typemaps */ /* %pybuffer_mutable_binary(TYPEMAP, SIZE) * diff --git a/Lib/python/pyerrors.swg b/Lib/python/pyerrors.swg index 01cf53e9b..63f0344e4 100644 --- a/Lib/python/pyerrors.swg +++ b/Lib/python/pyerrors.swg @@ -59,8 +59,7 @@ SWIG_Python_AddErrorMsg(const char* mesg) PyErr_Clear(); Py_XINCREF(type); - PyErr_Format(type, "%s %s", - SWIG_Python_str_AsChar(old_str), mesg); + PyErr_Format(type, "%s %s", SWIG_Python_str_AsChar(old_str), mesg); Py_DECREF(old_str); Py_DECREF(value); } else { diff --git a/Lib/python/pyhead.swg b/Lib/python/pyhead.swg index d73d3d112..ecafc46c8 100644 --- a/Lib/python/pyhead.swg +++ b/Lib/python/pyhead.swg @@ -2,19 +2,18 @@ #if PY_VERSION_HEX >= 0x03000000 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) - #define PyInt_Check(x) PyLong_Check(x) #define PyInt_AsLong(x) PyLong_AsLong(x) #define PyInt_FromLong(x) PyLong_FromLong(x) - #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) + #endif #ifndef Py_TYPE # define Py_TYPE(op) ((op)->ob_type) #endif -/* SWIG APIs for compatibility of boht Python 2 & 3 */ +/* SWIG APIs for compatibility of both Python 2 & 3 */ #if PY_VERSION_HEX >= 0x03000000 # define SWIG_Python_str_FromFormat PyUnicode_FromFormat @@ -88,6 +87,7 @@ PyString_FromFormat(const char *fmt, ...) { # define PyObject_GenericGetAttr 0 # endif #endif + /* Py_NotImplemented is defined in 2.1 and up. */ #if PY_VERSION_HEX < 0x02010000 # ifndef Py_NotImplemented @@ -95,7 +95,6 @@ PyString_FromFormat(const char *fmt, ...) { # endif #endif - /* A crude PyString_AsStringAndSize implementation for old Pythons */ #if PY_VERSION_HEX < 0x02010000 # ifndef PyString_AsStringAndSize @@ -110,7 +109,6 @@ PyString_FromFormat(const char *fmt, ...) { # endif #endif - /* PyBool_FromLong for old Pythons */ #if PY_VERSION_HEX < 0x02030000 static