Revision: 11604
Author: yang...@chromium.org
Date: Mon May 21 03:19:28 2012
Log: Fixing python deprecations.
Original patch by Alexey Stukalov <astuka...@gmail.com>.
BUG=v8:1391
TEST=
Review URL: https://chromiumcodereview.appspot.com/10412022
http://code.google.com/p/v8/source/detail?r=11604
Modified:
/branches/bleeding_edge/tools/js2c.py
/branches/bleeding_edge/tools/jsmin.py
=======================================
--- /branches/bleeding_edge/tools/js2c.py Tue Jan 24 06:29:02 2012
+++ /branches/bleeding_edge/tools/js2c.py Mon May 21 03:19:28 2012
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#
-# Copyright 2006-2008 the V8 project authors. All rights reserved.
+# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
@@ -195,14 +195,14 @@
macro_match = MACRO_PATTERN.match(line)
if macro_match:
name = macro_match.group(1)
- args = map(string.strip, macro_match.group(2).split(','))
+ 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)))
=======================================
--- /branches/bleeding_edge/tools/jsmin.py Thu Mar 8 08:38:44 2012
+++ /branches/bleeding_edge/tools/jsmin.py Mon May 21 03:19:28 2012
@@ -1,6 +1,6 @@
#!/usr/bin/python2.4
-# Copyright 2009 the V8 project authors. All rights reserved.
+# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
@@ -154,7 +154,7 @@
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 = (
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev