Python 3 syntax errors in inspector protocol
Reported by
ccla...@me.com,
Dec 13
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Firefox/60.0 Steps to reproduce the problem: 1. git clone https://chromium.googlesource.com/deps/inspector_protocol 2. flake8 . --select=E901,E999,F821,F822,F823 --show-source 3. What is the expected behavior? Inspector protocol would be compatible with the current release of Python. What went wrong? Flake8 testing of inspector protocol * print() is a function in Python 3 * xrange() was removed in Python 3 in favor of a reworked version of range() ./check_protocol_compatibility.py:478:46: E999 SyntaxError: invalid syntax print " Public changes since %s:" % version ^ ./code_generator.py:43:18: F821 undefined name 'xrange' for i in xrange(len(keys)): ^ ./pdl.py:162:51: E999 SyntaxError: invalid syntax print 'Error in %s:%s, illegal token: \t%s' % (file_name, i, line) ^ 2 E999 SyntaxError: invalid syntax 1 F821 undefined name 'xrange' 3 Did this work before? No Chrome version: <Copy from: 'about:version'> Channel: n/a OS Version: OS X 10.14 Flash Version: Shockwave Flash 32.0 r0
,
Dec 14
,
Dec 14
-> johannes appears to be the primary contributor to this repository over the last month.
,
Dec 20
The four changes are required. 1. https://chromium.googlesource.com/deps/inspector_protocol/+/master/pdl.py#162 add __()__ 2. https://chromium.googlesource.com/deps/inspector_protocol/+/master/check_protocol_compatibility.py#478 add __()__ 3. https://chromium.googlesource.com/deps/inspector_protocol/+/master/check_protocol_compatibility.py#480 add __()__ 4. https://chromium.googlesource.com/deps/inspector_protocol/+/master/code_generator.py#19 add the lines: ```python try: xrange # Python 2 except NameError: xrange = range # Python 3 ```
,
Dec 20
A fix for this is proposed in https://chromium-review.googlesource.com/c/deps/inspector_protocol/+/1387524
,
Jan 7
I'm assigning this to you. Please figure out what changes need to be made to the repro to fix this.
,
Jan 19
(4 days ago)
Any update on this issue. I see two open PRs that seem simple and acceptable for closing these syntax errors. |
||||
►
Sign in to add a comment |
||||
Comment 1 by dtapu...@chromium.org
, Dec 13