Author: Devin Jeanpierre <jeanpierr...@gmail.com>
Branch: seperate-strucmember_h
Changeset: r82132:f6a0fb5629d9
Date: 2016-01-30 23:53 -0800
http://bitbucket.org/pypy/pypy/changeset/f6a0fb5629d9/

Log:    Failing test case! This is what I want to fix.

        Existing Python programs may (okay, do) use symbols from
        structmember.h, and this works in CPython because structmember.h is
        not included from Python.h.

        In PyPy, if you include Python.h, then you can't use the name RO,
        because it does in fact include structmember.h. (And, indeed, our
        Python.h says that we should not.)

diff --git a/pypy/module/cpyext/test/test_cpyext.py 
b/pypy/module/cpyext/test/test_cpyext.py
--- a/pypy/module/cpyext/test/test_cpyext.py
+++ b/pypy/module/cpyext/test/test_cpyext.py
@@ -863,3 +863,15 @@
                 os.unlink('_imported_already')
             except OSError:
                 pass
+
+    def test_no_structmember(self):
+        """structmember.h should not be included by default."""
+        mod = self.import_extension('foo', [
+            ('bar', 'METH_NOARGS',
+             '''
+             /* reuse a name that is #defined in structmember.h */
+             int RO;
+             Py_RETURN_NONE;
+             '''
+             ),
+        ])
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to