fix PyString_CheckExact definition in Py3, minor cleanup
authorStefan Behnel <scoder@users.berlios.de>
Mon, 12 Oct 2009 07:03:21 +0000 (09:03 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Mon, 12 Oct 2009 07:03:21 +0000 (09:03 +0200)
Cython/Compiler/ModuleNode.py

index ed06bb18e600bfa7a9fc41f7cf62df88cf563a4f..c7ad7bc1db9fa713bd9762361a878dc86dc73795 100644 (file)
@@ -454,7 +454,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
         code.putln("  #define PyVarObject_HEAD_INIT(type, size) \\")
         code.putln("          PyObject_HEAD_INIT(type) size,")
         code.putln("  #define PyType_Modified(t)")
-        code.putln("  #define PyBytes_CheckExact(b) PyString_CheckExact(b)")
+        code.putln("  #define PyBytes_CheckExact PyString_CheckExact")
         code.putln("")
         code.putln("  typedef struct {")
         code.putln("     void *buf;")
@@ -496,7 +496,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
         code.putln("#if PY_MAJOR_VERSION >= 3")
         code.putln("  #define PyBaseString_Type            PyUnicode_Type")
         code.putln("  #define PyString_Type                PyUnicode_Type")
-        code.putln("  #define PyString_CheckExact          PyBytes_CheckExact")
+        code.putln("  #define PyString_CheckExact          PyUnicode_CheckExact")
         code.putln("  #define PyInt_Type                   PyLong_Type")
         code.putln("  #define PyInt_Check(op)              PyLong_Check(op)")
         code.putln("  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)")