Skip to content
Snippets Groups Projects
Commit f2dca32f authored by Dirk Pranke's avatar Dirk Pranke
Browse files

Update simple_copy.py for Python3 types.

Python 3 gets rid of 'str', 'long', so the file needed to be
tweaked slightly.

Bug: gyp:36
Change-Id: I7c820dfd6dfb5bfcf1a8ed315d67095557822757
Reviewed-on: https://chromium-review.googlesource.com/c/1360353


Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
parent f989ef9f
No related branches found
No related tags found
No related merge requests found
......@@ -28,8 +28,19 @@ _deepcopy_dispatch = d = {}
def _deepcopy_atomic(x):
return x
for x in (type(None), int, long, float,
bool, str, unicode, type):
try:
_string_types = (str, unicode)
# There's no unicode in python3
except NameError:
_string_types = (str, )
try:
_integer_types = (int, long)
# There's no long in python3
except NameError:
_integer_types = (int, )
for x in (type(None), float, bool, type) + _integer_types + _string_types:
d[x] = _deepcopy_atomic
def _deepcopy_list(x):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment