Issue #16719: Get rid of WindowsError. Use OSError instead

Patch by Serhiy Storchaka.
This commit is contained in:
Andrew Svetlov 2012-12-19 14:33:35 +02:00
parent 8a045cb93b
commit 2606a6f197
28 changed files with 79 additions and 87 deletions

View file

@ -66,7 +66,7 @@ def find_best_ssl_dir(sources):
# note: do not abspath s; the build will fail if any
# higher up directory name has spaces in it.
fnames = os.listdir(s)
except os.error:
except OSError:
fnames = []
for fname in fnames:
fqn = os.path.join(s, fname)

View file

@ -62,7 +62,7 @@ def find_best_ssl_dir(sources):
# note: do not abspath s; the build will fail if any
# higher up directory name has spaces in it.
fnames = os.listdir(s)
except os.error:
except OSError:
fnames = []
for fname in fnames:
fqn = os.path.join(s, fname)

View file

@ -71,7 +71,7 @@ def find_best_ssl_dir(sources):
# note: do not abspath s; the build will fail if any
# higher up directory name has spaces in it.
fnames = os.listdir(s)
except os.error:
except OSError:
fnames = []
for fname in fnames:
fqn = os.path.join(s, fname)

View file

@ -1794,9 +1794,9 @@ PyMODINIT_FUNC PyInit_winreg(void)
if (PyDict_SetItemString(d, "HKEYType",
(PyObject *)&PyHKEY_Type) != 0)
return NULL;
Py_INCREF(PyExc_WindowsError);
Py_INCREF(PyExc_OSError);
if (PyDict_SetItemString(d, "error",
PyExc_WindowsError) != 0)
PyExc_OSError) != 0)
return NULL;
/* Add the relevant constants */