Skip to content

Commit 80c5a50

Browse files
committed
Delete W601 -> W604 warnings
1 parent e9c846d commit 80c5a50

File tree

4 files changed

+0
-84
lines changed

4 files changed

+0
-84
lines changed

README.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,9 @@ Example usage and output
6565
optparse.py:69:11: E401 multiple imports on one line
6666
optparse.py:77:1: E302 expected 2 blank lines, found 1
6767
optparse.py:88:5: E301 expected 1 blank line, found 0
68-
optparse.py:222:34: W602 deprecated form of raising exception
6968
optparse.py:347:31: E211 whitespace before '('
7069
optparse.py:357:17: E201 whitespace after '{'
7170
optparse.py:472:29: E221 multiple spaces before operator
72-
optparse.py:544:21: W601 .has_key() is deprecated, use 'in'
7371

7472
You can also make ``pycodestyle.py`` show the source code for each error, and
7573
even the relevant text from PEP 8::
@@ -97,8 +95,6 @@ Or you can display how often each error was found::
9795
165 E303 too many blank lines (4)
9896
325 E401 multiple imports on one line
9997
3615 E501 line too long (82 characters)
100-
612 W601 .has_key() is deprecated, use 'in'
101-
1188 W602 deprecated form of raising exception
10298

10399
Links
104100
-----

docs/intro.rst

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,9 @@ Example usage and output
7171
optparse.py:69:11: E401 multiple imports on one line
7272
optparse.py:77:1: E302 expected 2 blank lines, found 1
7373
optparse.py:88:5: E301 expected 1 blank line, found 0
74-
optparse.py:222:34: W602 deprecated form of raising exception
7574
optparse.py:347:31: E211 whitespace before '('
7675
optparse.py:357:17: E201 whitespace after '{'
7776
optparse.py:472:29: E221 multiple spaces before operator
78-
optparse.py:544:21: W601 .has_key() is deprecated, use 'in'
7977

8078
You can also make ``pycodestyle.py`` show the source code for each error, and
8179
even the relevant text from PEP 8::
@@ -103,8 +101,6 @@ Or you can display how often each error was found::
103101
165 E303 too many blank lines (4)
104102
325 E401 multiple imports on one line
105103
3615 E501 line too long (82 characters)
106-
612 W601 .has_key() is deprecated, use 'in'
107-
1188 W602 deprecated form of raising exception
108104

109105
You can also make ``pycodestyle.py`` show the error text in different formats by
110106
using ``--format`` having options default/pylint/custom::
@@ -415,14 +411,6 @@ This is the current list of error and warning codes:
415411
+------------+----------------------------------------------------------------------+
416412
| **W6** | *Deprecation warning* |
417413
+------------+----------------------------------------------------------------------+
418-
| W601 | .has_key() is deprecated, use 'in' |
419-
+------------+----------------------------------------------------------------------+
420-
| W602 | deprecated form of raising exception |
421-
+------------+----------------------------------------------------------------------+
422-
| W603 | '<>' is deprecated, use '!=' |
423-
+------------+----------------------------------------------------------------------+
424-
| W604 | backticks are deprecated, use 'repr()' |
425-
+------------+----------------------------------------------------------------------+
426414
| W605 | invalid escape sequence '\x' |
427415
+------------+----------------------------------------------------------------------+
428416
| W606 | 'async' and 'await' are reserved keywords starting with Python 3.7 |

pycodestyle.py

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,59 +1563,6 @@ def ambiguous_identifier(logical_line, tokens):
15631563
prev_start = start
15641564

15651565

1566-
@register_check
1567-
def python_3000_has_key(logical_line, noqa):
1568-
r"""The {}.has_key() method is removed in Python 3: use the 'in'
1569-
operator.
1570-
1571-
Okay: if "alph" in d:\n print d["alph"]
1572-
W601: assert d.has_key('alph')
1573-
"""
1574-
pos = logical_line.find('.has_key(')
1575-
if pos > -1 and not noqa:
1576-
yield pos, "W601 .has_key() is deprecated, use 'in'"
1577-
1578-
1579-
@register_check
1580-
def python_3000_raise_comma(logical_line):
1581-
r"""When raising an exception, use "raise ValueError('message')".
1582-
1583-
The older form is removed in Python 3.
1584-
1585-
Okay: raise DummyError("Message")
1586-
W602: raise DummyError, "Message"
1587-
"""
1588-
match = RAISE_COMMA_REGEX.match(logical_line)
1589-
if match and not RERAISE_COMMA_REGEX.match(logical_line):
1590-
yield match.end() - 1, "W602 deprecated form of raising exception"
1591-
1592-
1593-
@register_check
1594-
def python_3000_not_equal(logical_line):
1595-
r"""New code should always use != instead of <>.
1596-
1597-
The older syntax is removed in Python 3.
1598-
1599-
Okay: if a != 'no':
1600-
W603: if a <> 'no':
1601-
"""
1602-
pos = logical_line.find('<>')
1603-
if pos > -1:
1604-
yield pos, "W603 '<>' is deprecated, use '!='"
1605-
1606-
1607-
@register_check
1608-
def python_3000_backticks(logical_line):
1609-
r"""Use repr() instead of backticks in Python 3.
1610-
1611-
Okay: val = repr(1 + 2)
1612-
W604: val = `1 + 2`
1613-
"""
1614-
pos = logical_line.find('`')
1615-
if pos > -1:
1616-
yield pos, "W604 backticks are deprecated, use 'repr()'"
1617-
1618-
16191566
@register_check
16201567
def python_3000_invalid_escape_sequence(logical_line, tokens, noqa):
16211568
r"""Invalid escape sequences are deprecated in Python 3.6.

testsuite/W60.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
#: W601
2-
if a.has_key("b"):
3-
print a
4-
#: W602
5-
raise DummyError, "Message"
6-
#: W602
7-
raise ValueError, "hello %s %s" % (1, 2)
8-
#: Okay
9-
raise type_, val, tb
10-
raise Exception, Exception("f"), t
11-
#: W603
12-
if x <> 0:
13-
x = 0
14-
#: W604
15-
val = `1 + 2`
161
#: W605:1:10
172
regex = '\.png$'
183
#: W605:2:1

0 commit comments

Comments
 (0)