mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Got rid of the _quotes global. Used only once, and is trivial.
This commit is contained in:
parent
55762f5f80
commit
ad5a771fae
1 changed files with 1 additions and 3 deletions
|
@ -156,8 +156,6 @@ _tuplesize2code = [EMPTY_TUPLE, TUPLE1, TUPLE2, TUPLE3]
|
||||||
__all__.extend([x for x in dir() if re.match("[A-Z][A-Z0-9_]+$",x)])
|
__all__.extend([x for x in dir() if re.match("[A-Z][A-Z0-9_]+$",x)])
|
||||||
del x
|
del x
|
||||||
|
|
||||||
_quotes = ["'", '"']
|
|
||||||
|
|
||||||
|
|
||||||
# Pickling machinery
|
# Pickling machinery
|
||||||
|
|
||||||
|
@ -826,7 +824,7 @@ class Unpickler:
|
||||||
|
|
||||||
def load_string(self):
|
def load_string(self):
|
||||||
rep = self.readline()[:-1]
|
rep = self.readline()[:-1]
|
||||||
for q in _quotes:
|
for q in "\"'": # double or single quote
|
||||||
if rep.startswith(q):
|
if rep.startswith(q):
|
||||||
if not rep.endswith(q):
|
if not rep.endswith(q):
|
||||||
raise ValueError, "insecure string pickle"
|
raise ValueError, "insecure string pickle"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue