]> granicus.if.org Git - python/commitdiff
Oops. Catching OverflowError from int() doesn't help, since it raises
authorGuido van Rossum <guido@python.org>
Wed, 17 Oct 2001 17:21:47 +0000 (17:21 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 17 Oct 2001 17:21:47 +0000 (17:21 +0000)
ValueError on too-large inputs.

Lib/ftplib.py

index 8d8d51fa8289b138c1941667e54f6180463840d0..592f5d29d2caa6be47b70248f7b16f9d74d69e02 100644 (file)
@@ -508,7 +508,7 @@ class FTP:
             s = resp[3:].strip()
             try:
                 return int(s)
-            except OverflowError:
+            except (OverflowError, ValueError):
                 return long(s)
 
     def mkd(self, dirname):
@@ -558,7 +558,7 @@ def parse150(resp):
     s = m.group(1)
     try:
         return int(s)
-    except OverflowError:
+    except (OverflowError, ValueError):
         return long(s)