# HG changeset patch # User Matt Mackall # Date 1432042864 18000 # Node ID a39c35e8e559e238f311c647679e8de3b91748c6 # Parent 22f4ce49044d96e97f9858f5981ba5f54cc4aced check-code: reintroduce str.format() ban for 3.x porting In their infinite wisdom, the Python maintainers stripped bytes of its % and format() methods for 3.x. They've now added % back to 3.5, but format() is still missing. Since we don't have any particular need for it, we should keep avoiding it. diff -r 22f4ce49044d -r a39c35e8e559 contrib/check-code.py --- a/contrib/check-code.py Mon May 18 23:43:36 2015 -0500 +++ b/contrib/check-code.py Tue May 19 08:41:04 2015 -0500 @@ -239,6 +239,7 @@ # (r'in range\(', "use xrange"), # (r'^\s*print\s+', "avoid using print in core and extensions"), (r'[\x80-\xff]', "non-ASCII character literal"), + (r'("\')\.format\(', "str.format() has no bytes counterpart, use %"), (r'^\s*(%s)\s\s' % '|'.join(keyword.kwlist), "gratuitous whitespace after Python keyword"), (r'([\(\[][ \t]\S)|(\S[ \t][\)\]])', "gratuitous whitespace in () or []"),