Skip to content

Commit 057bc45

Browse files
committed
Revert "As it's requires a PEP, lets trigger a syntax warning"
This reverts commit cd9bf16.
1 parent cd9bf16 commit 057bc45

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

Lib/test/test_grammar.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ def test_plain_integers(self):
7777
def test_attrs_on_hexintegers(self):
7878
good_meth = [m for m in dir(int) if not m.startswith('_')]
7979
for m in good_meth:
80-
with self.assertWarns(SyntaxWarning):
81-
v = eval('0x1.' + m)
82-
self.assertEqual(v, eval('(0x1).' + m))
80+
self.assertEqual(eval('0x1.' + m), eval('(0x1).' + m))
8381
self.check_syntax_error('0x1.spam', "invalid hexadecimal literal",
8482
lineno=1, offset=4)
8583
self.check_syntax_error('0x1.foo', "invalid hexadecimal literal",

Lib/test/test_zstd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ def test_is_raw(self):
12391239
ZstdDict(desk333=345)
12401240

12411241
def test_invalid_dict(self):
1242-
DICT_MAGIC = (0xEC30A437).to_bytes(4, byteorder='little')
1242+
DICT_MAGIC = 0xEC30A437.to_bytes(4, byteorder='little')
12431243
dict_content = DICT_MAGIC + b'abcdefghighlmnopqrstuvwxyz'
12441244

12451245
# corrupted

Parser/lexer/lexer.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -896,11 +896,6 @@ tok_get_normal_mode(struct tok_state *tok, tokenizer_mode* current_tok, struct t
896896
(c == 'n' && lookahead(tok, "umerator")) ||
897897
(c == 'r' && lookahead(tok, "eal")))
898898
{
899-
if (_PyTokenizer_parser_warn(tok, PyExc_SyntaxWarning,
900-
"invalid float literal"))
901-
{
902-
return 0;
903-
}
904899
tok_backup(tok, c);
905900
c = '.';
906901
goto hexint;

0 commit comments

Comments
 (0)