[pypy-commit] cffi cpy-extension: Insert spaces around '__dotdotdot__'.

arigo noreply at buildbot.pypy.org
Thu Jun 14 12:30:39 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: cpy-extension
Changeset: r326:e92c620af03e
Date: 2012-06-14 12:30 +0200
http://bitbucket.org/cffi/cffi/changeset/e92c620af03e/

Log:	Insert spaces around '__dotdotdot__'.

diff --git a/cffi/cparser.py b/cffi/cparser.py
--- a/cffi/cparser.py
+++ b/cffi/cparser.py
@@ -17,8 +17,9 @@
     for number, match in enumerate(reversed(matches)):
         p = match.start()
         assert csource[p:p+3] == '...'
-        csource = '%s__dotdotdot%d__%s' % (csource[:p], number, csource[p+3:])
-    return csource.replace('...', '__dotdotdot__')
+        csource = '%s __dotdotdot%d__ %s' % (csource[:p], number,
+                                             csource[p+3:])
+    return csource.replace('...', ' __dotdotdot__ ')
 
 class Parser(object):
     def __init__(self):
diff --git a/testing/test_verify.py b/testing/test_verify.py
--- a/testing/test_verify.py
+++ b/testing/test_verify.py
@@ -147,7 +147,7 @@
 
 def test_missing_typedef():
     ffi = FFI()
-    ffi.cdef("typedef ... foo_t; int bar(foo_t *);")
+    ffi.cdef("typedef...foo_t; int bar(foo_t *);")
     py.test.raises(TypeError, ffi.new, "foo_t")
     lib = ffi.verify("typedef struct foo_s { int x; } foo_t;\n"
                      "int bar(foo_t *f) { return 42; }\n")


More information about the pypy-commit mailing list