summaryrefslogtreecommitdiffstats
path: root/Doc/includes/email-unpack.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-11-15 09:11:48 (GMT)
committerGitHub <noreply@github.com>2019-11-15 09:11:48 (GMT)
commitdae27cc8e72106c2eceeff9af83d1e58b2bb68d5 (patch)
tree56164ccb22afc000f7ee52af2b074106c3e859f3 /Doc/includes/email-unpack.py
parent694c03fabb5cf3df0102cc317670a10fc39c6786 (diff)
downloadcpython-dae27cc8e72106c2eceeff9af83d1e58b2bb68d5.zip
cpython-dae27cc8e72106c2eceeff9af83d1e58b2bb68d5.tar.gz
cpython-dae27cc8e72106c2eceeff9af83d1e58b2bb68d5.tar.bz2
bpo-38351: Modernize email examples from %-formatting to f-strings (GH-17162)
(cherry picked from commit e8acc865a3f112b98417f676c897ca6ec2dac2c7) Co-authored-by: Andrey Doroschenko <dorosch.github.io@yandex.ru>
Diffstat (limited to 'Doc/includes/email-unpack.py')
-rw-r--r--Doc/includes/email-unpack.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/includes/email-unpack.py b/Doc/includes/email-unpack.py
index e0a7f01..c8cb0be 100644
--- a/Doc/includes/email-unpack.py
+++ b/Doc/includes/email-unpack.py
@@ -43,7 +43,7 @@ Unpack a MIME message into a directory of files.
if not ext:
# Use a generic bag-of-bits extension
ext = '.bin'
- filename = 'part-%03d%s' % (counter, ext)
+ filename = f'part-{counter:03d}{ext}'
counter += 1
with open(os.path.join(args.directory, filename), 'wb') as fp:
fp.write(part.get_payload(decode=True))