[Python-checkins] cpython (merge 3.1 -> 3.2): merge 3.1

benjamin.peterson python-checkins at python.org
Wed Apr 13 01:34:05 CEST 2011


http://hg.python.org/cpython/rev/d25c2812b0d8
changeset: 69290:d25c2812b0d8
branch: 3.2
parent: 69285:2924d01e31ad
parent: 69289:1ea945be3d09
user: Benjamin Peterson <benjamin at python.org>
date: Tue Apr 12 18:34:30 2011 -0500
summary:
 merge 3.1
files:
 Lib/test/test_syntax.py | 4 ++++
 Misc/NEWS | 3 +++
 Python/ast.c | 1 +
 3 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -67,6 +67,10 @@
 Traceback (most recent call last):
 SyntaxError: can't assign to literal
 
+>>> b"" = 1
+Traceback (most recent call last):
+SyntaxError: can't assign to literal
+
 >>> `1` = 1
 Traceback (most recent call last):
 SyntaxError: invalid syntax
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -490,6 +490,9 @@
 
 - Add sys.flags attribute for the new -q command-line option.
 
+- Issue #11506: Trying to assign to a bytes literal should result in a
+ SyntaxError.
+
 Library
 -------
 
diff --git a/Python/ast.c b/Python/ast.c
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -483,6 +483,7 @@
 case Set_kind:
 case Num_kind:
 case Str_kind:
+ case Bytes_kind:
 expr_name = "literal";
 break;
 case Ellipsis_kind:
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /