[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, 1 Mar 2012 11:03:50 +0000 (12:03 +0100)
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: I5528baa43f1be8d06efc9159fee7ea52f77d3ad8
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
src/3rdparty/v8/tools/js2c.py
src/3rdparty/v8/tools/jsmin.py

index a2ea8ea..fe6a72e 100644 (file)
@@ -194,14 +194,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 646bf14..395441b 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 = (