mercurial/py3kcompat.py
changeset 17424 e7cfe3587ea4
parent 11878 8bb1481cf08f
child 21291 007d276f8c94
equal deleted inserted replaced
17406:fc14953e8e34 17424:e7cfe3587ea4
    10 from numbers import Number
    10 from numbers import Number
    11 
    11 
    12 def bytesformatter(format, args):
    12 def bytesformatter(format, args):
    13     '''Custom implementation of a formatter for bytestrings.
    13     '''Custom implementation of a formatter for bytestrings.
    14 
    14 
    15     This function currently relias on the string formatter to do the
    15     This function currently relies on the string formatter to do the
    16     formatting and always returns bytes objects.
    16     formatting and always returns bytes objects.
    17 
    17 
    18     >>> bytesformatter(20, 10)
    18     >>> bytesformatter(20, 10)
    19     0
    19     0
    20     >>> bytesformatter('unicode %s, %s!', ('string', 'foo'))
    20     >>> bytesformatter('unicode %s, %s!', ('string', 'foo'))