Commit 9527e61f authored by Tim Peters's avatar Tim Peters

Got rid of the _quotes global. Used only once, and is trivial.

parent 85208ad3
...@@ -156,8 +156,6 @@ _tuplesize2code = [EMPTY_TUPLE, TUPLE1, TUPLE2, TUPLE3] ...@@ -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: ...@@ -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"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment