summaryrefslogtreecommitdiff
path: root/Lib/stringold.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-08-16 13:29:03 +0000
committerGuido van Rossum <guido@python.org>1991-08-16 13:29:03 +0000
commite417893dd49753bc24d0ad674bf4fbf18bfa0258 (patch)
treed3b33e4642247236044c03d9152daab7b98fb82c /Lib/stringold.py
parentbd9953ff2a723adb9b27583adacbda21189fd39b (diff)
downloadcpython-e417893dd49753bc24d0ad674bf4fbf18bfa0258.tar.gz
A plus is also a sign!
Diffstat (limited to 'Lib/stringold.py')
-rw-r--r--Lib/stringold.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/stringold.py b/Lib/stringold.py
index c245a493af..1c45ab3b86 100644
--- a/Lib/stringold.py
+++ b/Lib/stringold.py
@@ -142,6 +142,6 @@ def zfill(x, width):
n = len(s)
if n >= width: return s
sign = ''
- if s[0] = '-':
- sign, s = '-', s[1:]
+ if s[0] in ('-', '+'):
+ sign, s = s[0], s[1:]
return sign + '0'*(width-n) + s