# HG changeset patch # User Jun Wu # Date 1456339334 0 # Node ID 97fe88806f6f0f9ba3c0acb5ea4c67697f11f78c # Parent 41dcd754526612c43b9695df8851557c851828ef check-code: allow old style class with special comments The following chgserver change will use an old style class to comply with SocketServer's code style. This patch made it possible to pass check-code. diff -r 41dcd7545266 -r 97fe88806f6f contrib/check-code.py --- a/contrib/check-code.py Wed Feb 24 15:55:44 2016 -0600 +++ b/contrib/check-code.py Wed Feb 24 18:42:14 2016 +0000 @@ -245,9 +245,11 @@ "don't use camelcase in identifiers"), (r'^\s*(if|while|def|class|except|try)\s[^[\n]*:\s*[^\\n]#\s]+', "linebreak after :"), - (r'class\s[^( \n]+:', "old-style class, use class foo(object)"), + (r'class\s[^( \n]+:', "old-style class, use class foo(object)", + r'#.*old-style'), (r'class\s[^( \n]+\(\):', - "class foo() creates old style object, use class foo(object)"), + "class foo() creates old style object, use class foo(object)", + r'#.*old-style'), (r'\b(%s)\(' % '|'.join(k for k in keyword.kwlist if k not in ('print', 'exec')), "Python keyword is not a function"),