summaryrefslogtreecommitdiffstats
path: root/Modules/cgen.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1990-12-20 15:06:42 (GMT)
committerGuido van Rossum <guido@python.org>1990-12-20 15:06:42 (GMT)
commit3f5da24ea304e674a9abbdcffc4d671e32aa70f1 (patch)
treee932e31cb9381f40b7c87c377638216c043b5cfc /Modules/cgen.py
parent226d79eb4a776dd54c9e4544b17deaf928bcef3a (diff)
downloadcpython-3f5da24ea304e674a9abbdcffc4d671e32aa70f1.zip
cpython-3f5da24ea304e674a9abbdcffc4d671e32aa70f1.tar.gz
cpython-3f5da24ea304e674a9abbdcffc4d671e32aa70f1.tar.bz2
"Compiling" version
Diffstat (limited to 'Modules/cgen.py')
-rw-r--r--Modules/cgen.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/cgen.py b/Modules/cgen.py
index 0cdeaa6..1e345d1 100644
--- a/Modules/cgen.py
+++ b/Modules/cgen.py
@@ -33,8 +33,8 @@ digits = '0123456789'
#
def getnum(s):
n = ''
- while s[:1] in digits:
- n = n + s[:1]
+ while s and s[0] in digits:
+ n = n + s[0]
s = s[1:]
return n, s