[pypy-commit] pypy default: update to cffi/158f2ff652b7
arigo
pypy.commits at gmail.com
Fri Jul 19 16:47:54 EDT 2019
Author: Armin Rigo <arigo at tunes.org>
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
More information about the pypy-commit
mailing list