# HG changeset patch # User Jun Wu # Date 2016-02-24 18:42:14 # 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 --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -245,9 +245,11 @@ pypats = [ "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"),