]> granicus.if.org Git - python/commitdiff
Use ValueError, not RuntimeError for a utime flag combination illegal on some systems.
authorGeorg Brandl <georg@python.org>
Tue, 26 Jun 2012 07:25:44 +0000 (09:25 +0200)
committerGeorg Brandl <georg@python.org>
Tue, 26 Jun 2012 07:25:44 +0000 (09:25 +0200)
Lib/test/test_posix.py
Modules/posixmodule.c

index 776439f9266a9754ef71a06006555fe67e7850f7..9bedc7d2377b0ad4530a53ab9052734658d1fe26 100644 (file)
@@ -730,7 +730,7 @@ class PosixTester(unittest.TestCase):
             if os.utime in os.supports_follow_symlinks:
                 try:
                     posix.utime(support.TESTFN, follow_symlinks=False, dir_fd=f)
-                except RuntimeError:
+                except ValueError:
                     # whoops!  using both together not supported on this platform.
                     pass
 
index 8f2bbfbaa70601cf4866330584ca17884385a29a..82626a8810180c01d7643e16380f409fa3f49620 100644 (file)
@@ -4667,7 +4667,7 @@ posix_utime(PyObject *self, PyObject *args, PyObject *kwargs)
 
 #if !defined(HAVE_UTIMENSAT)
     if ((dir_fd != DEFAULT_DIR_FD) && (!follow_symlinks)) {
-        PyErr_SetString(PyExc_RuntimeError,
+        PyErr_SetString(PyExc_ValueError,
                      "utime: cannot use dir_fd and follow_symlinks "
                      "together on this platform");
         goto exit;