#13579: minimize code base drift for 'a' string.Formatter change.

2.7 doesn't support 'a'.  This changeset ports the doc change
and clause-reording portions of Francisco Martín Brugué patch
in order to minimize code base drift.
This commit is contained in:
R David Murray 2012-08-19 17:57:29 -04:00
parent 0e3a4c8058
commit d928b6a965
2 changed files with 10 additions and 9 deletions

View file

@ -601,12 +601,12 @@ class Formatter(object):
def convert_field(self, value, conversion):
# do any conversion on the resulting object
if conversion == 'r':
return repr(value)
if conversion is None:
return value
elif conversion == 's':
return str(value)
elif conversion is None:
return value
elif conversion == 'r':
return repr(value)
raise ValueError("Unknown conversion specifier {0!s}".format(conversion))