Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r97010:3cb9cee3bc8e
Date: 2019-07-19 22:47 +0200
http://bitbucket.org/pypy/pypy/changeset/3cb9cee3bc8e/

Log:    update to cffi/158f2ff652b7

diff --git a/lib_pypy/cffi/cparser.py b/lib_pypy/cffi/cparser.py
--- a/lib_pypy/cffi/cparser.py
+++ b/lib_pypy/cffi/cparser.py
@@ -145,12 +145,16 @@
     return ''.join(parts)
 
 def _warn_for_string_literal(csource):
-    if '"' in csource:
-        import warnings
-        warnings.warn("String literal found in cdef() or type source. "
-                      "String literals are ignored here, but you should "
-                      "remove them anyway because some character sequences "
-                      "confuse pre-parsing.")
+    if '"' not in csource:
+        return
+    for line in csource.splitlines():
+        if '"' in line and not line.lstrip().startswith('#'):
+            import warnings
+            warnings.warn("String literal found in cdef() or type source. "
+                          "String literals are ignored here, but you should "
+                          "remove them anyway because some character sequences 
"
+                          "confuse pre-parsing.")
+            break
 
 def _preprocess(csource):
     # Remove comments.  NOTE: this only work because the cdef() section
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to