Author: guillaumesottas@Guillaumes-MacBook-Pro.local Branch: Changeset: r3251:fa1ef05714de Date: 2019-03-26 17:23 -0600 http://bitbucket.org/cffi/cffi/changeset/fa1ef05714de/
Log: remove extra comments. diff --git a/cffi/cparser.py b/cffi/cparser.py --- a/cffi/cparser.py +++ b/cffi/cparser.py @@ -818,15 +818,13 @@ if isinstance(exprnode, pycparser.c_ast.Constant): s = exprnode.value if '0' <= s[0] <= '9': - s = s.rstrip('uUlL') # remove integer constant suffix if any. this will remove pattern such as lL, but - # it is the responsibility of the C parser to perform this check. - try: # first we try to convert to base 8/10, as it will fail if the string contains base 2/16 C prefix. + s = s.rstrip('uUlL') + try: if s.startswith('0'): return int(s, 8) else: return int(s, 10) - except ValueError: # then it should be a base 2 or a base 16. it is necessary to explicitly check the - # prefix, as python's int() function will be able to convert both (0b01 and 0x0b01) into base 16. + except ValueError: if len(s) > 1: if s.lower()[0:2] == '0x': return int(s, 16) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit