]> granicus.if.org Git - python/commitdiff
Strip argument to atol and atof to match what strop does better.
authorGuido van Rossum <guido@python.org>
Mon, 30 Mar 1998 17:22:30 +0000 (17:22 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 30 Mar 1998 17:22:30 +0000 (17:22 +0000)
Lib/string.py
Lib/stringold.py

index f2c37440a67ba2666edd68d7b9ca8460ca59488f..1a0f53033775e7df4b998c843afebcba5d526862 100644 (file)
@@ -374,7 +374,7 @@ def atoi(str, base=10):
                # We only get here if strop doesn't define atoi()
                raise ValueError, "this string.atoi doesn't support base != 10"
        sign = ''
-       s = str
+       s = strip(str)
        if s and s[0] in '+-':
                sign = s[0]
                s = s[1:]
@@ -403,7 +403,7 @@ def atol(str, base=10):
                # We only get here if strop doesn't define atol()
                raise ValueError, "this string.atol doesn't support base != 10"
        sign = ''
-       s = str
+       s = strip(str)
        if s and s[0] in '+-':
                sign = s[0]
                s = s[1:]
index f2c37440a67ba2666edd68d7b9ca8460ca59488f..1a0f53033775e7df4b998c843afebcba5d526862 100644 (file)
@@ -374,7 +374,7 @@ def atoi(str, base=10):
                # We only get here if strop doesn't define atoi()
                raise ValueError, "this string.atoi doesn't support base != 10"
        sign = ''
-       s = str
+       s = strip(str)
        if s and s[0] in '+-':
                sign = s[0]
                s = s[1:]
@@ -403,7 +403,7 @@ def atol(str, base=10):
                # We only get here if strop doesn't define atol()
                raise ValueError, "this string.atol doesn't support base != 10"
        sign = ''
-       s = str
+       s = strip(str)
        if s and s[0] in '+-':
                sign = s[0]
                s = s[1:]