[pypy-svn] r61447 - pypy/trunk/pypy/lib

antocuni at codespeak.net antocuni at codespeak.net
Thu Jan 29 14:18:15 CET 2009

Author: antocuni
Date: Thu Jan 29 14:18:14 2009
New Revision: 61447

cpython makes a difference between field_size_limit() and
field_size_limit(None).  This fixes one test in test_csv

Modified: pypy/trunk/pypy/lib/_csv.py
--- pypy/trunk/pypy/lib/_csv.py	(original)
+++ pypy/trunk/pypy/lib/_csv.py	Thu Jan 29 14:18:14 2009
@@ -512,20 +512,19 @@
     The \"fileobj\" argument can be any object that supports the file API."""
     return Writer(*args, **kwargs)
-def field_size_limit(limit=None):
+undefined = object()
+def field_size_limit(limit=undefined):
     """Sets an upper limit on parsed fields.
     Returns old limit. If limit is not given, no new limit is set and
     the old limit is returned"""
-    if not isinstance(limit, (long, int)):
-        raise TypeError("limit must be an integer")
     global _field_limit
     old_limit = _field_limit
-    if limit is not None:
+    if limit is not undefined:
         if not isinstance(limit, (int, long)):
             raise TypeError("int expected, got %s" %

More information about the Pypy-commit mailing list