check-code: allow print and exec as a function
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 13 May 2015 11:39:48 -0700
changeset 25028 62c2786b4327
parent 25027 297ea0df75d0
child 25029 e0ce8d8630f3
check-code: allow print and exec as a function This is required to move forward on python3 compatibility.
contrib/check-code.py
--- a/contrib/check-code.py	Wed May 06 15:58:14 2015 -0700
+++ b/contrib/check-code.py	Wed May 13 11:39:48 2015 -0700
@@ -238,7 +238,8 @@
     (r'class\s[^( \n]+:', "old-style class, use class foo(object)"),
     (r'class\s[^( \n]+\(\):',
      "class foo() not available in Python 2.4, use class foo(object)"),
-    (r'\b(%s)\(' % '|'.join(keyword.kwlist),
+    (r'\b(%s)\(' % '|'.join(k for k in keyword.kwlist
+                            if k not in ('print', 'exec')),
      "Python keyword is not a function"),
     (r',]', "unneeded trailing ',' in list"),
 #    (r'class\s[A-Z][^\(]*\((?!Exception)',