[V8] Fix deprecated Python code
authorKent Hansen <kent.hansen@nokia.com>
Fri, 2 Sep 2011 10:03:09 +0000 (12:03 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 26 Apr 2012 06:56:50 +0000 (08:56 +0200)
Needed to make the scripts run on Python 3, which is the
default python interpreter on some newer distros.

Patch from http://code.google.com/p/v8/issues/detail?id=1391

Change-Id: I5d5a0250b252b114586cfad7b1a713fde1cae1cf
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
src/3rdparty/v8/tools/js2c.py
src/3rdparty/v8/tools/jsmin.py

index fa559f3..b41948f 100644 (file)
@@ -195,14 +195,14 @@ def ReadMacros(lines):
       macro_match = MACRO_PATTERN.match(line)
       if macro_match:
         name = macro_match.group(1)
-        args = map(string.strip, macro_match.group(2).split(','))
+        args = args = [match.strip() for match in macro_match.group(2).split(',')]
         body = macro_match.group(3).strip()
         macros.append((re.compile("\\b%s\\(" % name), TextMacro(args, body)))
       else:
         python_match = PYTHON_MACRO_PATTERN.match(line)
         if python_match:
           name = python_match.group(1)
-          args = map(string.strip, python_match.group(2).split(','))
+          args = [match.strip() for match in python_match.group(2).split(',')]
           body = python_match.group(3).strip()
           fun = eval("lambda " + ",".join(args) + ': ' + body)
           macros.append((re.compile("\\b%s\\(" % name), PythonMacro(args, fun)))
index e82f3d0..49e0034 100644 (file)
@@ -154,7 +154,7 @@ class JavaScriptMinifier(object):
       return var_name
     while True:
       identifier_first_char = self.identifier_counter % 52
-      identifier_second_char = self.identifier_counter / 52
+      identifier_second_char = self.identifier_counter // 52
       new_identifier = self.CharFromNumber(identifier_first_char)
       if identifier_second_char != 0:
         new_identifier = (