Skip to content

Commit

Permalink
Remove unnecessary numeric placeholders from format strings (#176)
Browse files Browse the repository at this point in the history
Has been unnecessary since Python 2.7.
  • Loading branch information
jdufresne committed Dec 8, 2020
1 parent 6a59c4b commit e4290b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions chardet/__init__.py
Expand Up @@ -34,7 +34,7 @@ def detect(byte_str):
if not isinstance(byte_str, bytearray):
if not isinstance(byte_str, bytes):
raise TypeError('Expected object of type bytes or bytearray, got: '
'{0}'.format(type(byte_str)))
'{}'.format(type(byte_str)))
else:
byte_str = bytearray(byte_str)
detector = UniversalDetector()
Expand All @@ -52,7 +52,7 @@ def detect_all(byte_str):
if not isinstance(byte_str, bytearray):
if not isinstance(byte_str, bytes):
raise TypeError('Expected object of type bytes or bytearray, got: '
'{0}'.format(type(byte_str)))
'{}'.format(type(byte_str)))
else:
byte_str = bytearray(byte_str)

Expand Down
6 changes: 3 additions & 3 deletions chardet/cli/chardetect.py
Expand Up @@ -44,10 +44,10 @@ def description_of(lines, name='stdin'):
if PY2:
name = name.decode(sys.getfilesystemencoding(), 'ignore')
if result['encoding']:
return '{0}: {1} with confidence {2}'.format(name, result['encoding'],
return '{}: {} with confidence {}'.format(name, result['encoding'],
result['confidence'])
else:
return '{0}: no result'.format(name)
return '{}: no result'.format(name)


def main(argv=None):
Expand All @@ -68,7 +68,7 @@ def main(argv=None):
type=argparse.FileType('rb'), nargs='*',
default=[sys.stdin if PY2 else sys.stdin.buffer])
parser.add_argument('--version', action='version',
version='%(prog)s {0}'.format(__version__))
version='%(prog)s {}'.format(__version__))
args = parser.parse_args(argv)

for f in args.input:
Expand Down

0 comments on commit e4290b6

Please sign in to comment.