Skip to content

Commit 28a38e3

Browse files
Fixing python deprecations.
Original patch by Alexey Stukalov <[email protected]>. BUG=v8:1391 TEST= Review URL: https://chromiumcodereview.appspot.com/10412022 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@11604 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
1 parent 57b2c53 commit 28a38e3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tools/js2c.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
#
3-
# Copyright 2006-2008 the V8 project authors. All rights reserved.
3+
# Copyright 2012 the V8 project authors. All rights reserved.
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions are
66
# met:
@@ -195,14 +195,14 @@ def ReadMacros(lines):
195195
macro_match = MACRO_PATTERN.match(line)
196196
if macro_match:
197197
name = macro_match.group(1)
198-
args = map(string.strip, macro_match.group(2).split(','))
198+
args = [match.strip() for match in macro_match.group(2).split(',')]
199199
body = macro_match.group(3).strip()
200200
macros.append((re.compile("\\b%s\\(" % name), TextMacro(args, body)))
201201
else:
202202
python_match = PYTHON_MACRO_PATTERN.match(line)
203203
if python_match:
204204
name = python_match.group(1)
205-
args = map(string.strip, python_match.group(2).split(','))
205+
args = [match.strip() for match in python_match.group(2).split(',')]
206206
body = python_match.group(3).strip()
207207
fun = eval("lambda " + ",".join(args) + ': ' + body)
208208
macros.append((re.compile("\\b%s\\(" % name), PythonMacro(args, fun)))

tools/jsmin.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python2.4
22

3-
# Copyright 2009 the V8 project authors. All rights reserved.
3+
# Copyright 2012 the V8 project authors. All rights reserved.
44
# Redistribution and use in source and binary forms, with or without
55
# modification, are permitted provided that the following conditions are
66
# met:
@@ -154,7 +154,7 @@ def FindNewName(self, var_name):
154154
return var_name
155155
while True:
156156
identifier_first_char = self.identifier_counter % 52
157-
identifier_second_char = self.identifier_counter / 52
157+
identifier_second_char = self.identifier_counter // 52
158158
new_identifier = self.CharFromNumber(identifier_first_char)
159159
if identifier_second_char != 0:
160160
new_identifier = (

0 commit comments

Comments
 (0)