changeset 25028:62c2786b4327

check-code: allow print and exec as a function This is required to move forward on python3 compatibility.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 13 May 2015 11:39:48 -0700
parents 297ea0df75d0
children e0ce8d8630f3
files contrib/check-code.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)',