mirror of
https://github.com/python/cpython.git
synced 2025-11-13 07:26:31 +00:00
Use ValueError, not RuntimeError for a utime flag combination illegal on some systems.
This commit is contained in:
parent
a4b018f0cd
commit
969288e488
2 changed files with 2 additions and 2 deletions
|
|
@ -730,7 +730,7 @@ class PosixTester(unittest.TestCase):
|
||||||
if os.utime in os.supports_follow_symlinks:
|
if os.utime in os.supports_follow_symlinks:
|
||||||
try:
|
try:
|
||||||
posix.utime(support.TESTFN, follow_symlinks=False, dir_fd=f)
|
posix.utime(support.TESTFN, follow_symlinks=False, dir_fd=f)
|
||||||
except RuntimeError:
|
except ValueError:
|
||||||
# whoops! using both together not supported on this platform.
|
# whoops! using both together not supported on this platform.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4667,7 +4667,7 @@ posix_utime(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||||
|
|
||||||
#if !defined(HAVE_UTIMENSAT)
|
#if !defined(HAVE_UTIMENSAT)
|
||||||
if ((dir_fd != DEFAULT_DIR_FD) && (!follow_symlinks)) {
|
if ((dir_fd != DEFAULT_DIR_FD) && (!follow_symlinks)) {
|
||||||
PyErr_SetString(PyExc_RuntimeError,
|
PyErr_SetString(PyExc_ValueError,
|
||||||
"utime: cannot use dir_fd and follow_symlinks "
|
"utime: cannot use dir_fd and follow_symlinks "
|
||||||
"together on this platform");
|
"together on this platform");
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue