[Python-checkins] r57232 - python/branches/alex-py3k/Modules/_stringiomodule.c

alexandre.vassalotti python-checkins at python.org
Tue Aug 21 04:00:32 CEST 2007


Author: alexandre.vassalotti
Date: Tue Aug 21 04:00:31 2007
New Revision: 57232

Modified:
   python/branches/alex-py3k/Modules/_stringiomodule.c
Log:
Return NULL after setting an exception (oops).


Modified: python/branches/alex-py3k/Modules/_stringiomodule.c
==============================================================================
--- python/branches/alex-py3k/Modules/_stringiomodule.c	(original)
+++ python/branches/alex-py3k/Modules/_stringiomodule.c	Tue Aug 21 04:00:31 2007
@@ -328,9 +328,10 @@
                      "Negative seek position %zd", newpos);
         return NULL;
     }
-    if (newpos != 0 && mode != 0) {
+    if (mode != 0 && newpos != 0) {
         PyErr_SetString(PyExc_IOError, 
                         "Can't do nonzero cur-relative seeks");
+        return NULL;
     }
 
     /* mode 0: offset relative to beginning of the string.


More information about the Python-checkins mailing list