minor typo and formatting improvements
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10868 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6588eb61f4
commit
7ec3c4ae81
3 changed files with 5 additions and 8 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/* Impelementing buffer protocol typemaps */
|
||||
/* Implementing buffer protocol typemaps */
|
||||
|
||||
/* %pybuffer_mutable_binary(TYPEMAP, SIZE)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue