summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2010-09-22 20:58:04 (GMT)
committerBarry Warsaw <barry@python.org>2010-09-22 20:58:04 (GMT)
commit31c604d3a7ed0872b0a861ce8480245ff31db37c (patch)
tree4c67b4664798ce9d4d4770f27983356d7c9d9520
parent0258ce8f0a992ffe24a7b77314603cc7224c3971 (diff)
downloadcpython-31c604d3a7ed0872b0a861ce8480245ff31db37c.zip
cpython-31c604d3a7ed0872b0a861ce8480245ff31db37c.tar.gz
cpython-31c604d3a7ed0872b0a861ce8480245ff31db37c.tar.bz2
Issue 9916: Add some missing errno symbols.
-rwxr-xr-xLib/test/test_errno.py3
-rw-r--r--Misc/NEWS6
-rw-r--r--Modules/errnomodule.c30
3 files changed, 36 insertions, 3 deletions
diff --git a/Lib/test/test_errno.py b/Lib/test/test_errno.py
index e7d5ce5..f414a87 100755
--- a/Lib/test/test_errno.py
+++ b/Lib/test/test_errno.py
@@ -20,7 +20,8 @@ class ErrnoAttributeTests(unittest.TestCase):
def test_using_errorcode(self):
# Every key value in errno.errorcode should be on the module.
for value in errno.errorcode.values():
- self.assertTrue(hasattr(errno, value), 'no %s attr in errno' % value)
+ self.assertTrue(hasattr(errno, value),
+ 'no %s attr in errno' % value)
class ErrorcodeTests(unittest.TestCase):
diff --git a/Misc/NEWS b/Misc/NEWS
index 290d6a2..b4f830b 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -14,8 +14,8 @@ Core and Builtins
threads are still running. Instead, reinitialize the GIL on a second call to
Py_Initialize().
-- All SyntaxErrors now have a column offset and therefore a caret when the error
- is printed.
+- All SyntaxErrors now have a column offset and therefore a caret when the
+ error is printed.
- Issue #9252: PyImport_Import no longer uses a fromlist hack to return the
module that was imported, but instead gets the module from sys.modules.
@@ -62,6 +62,8 @@ Core and Builtins
Library
-------
+- Issue #9916: Add some missing errno symbols.
+
- Issue #9877: Expose sysconfig.get_makefile_filename()
- logging: Added hasHandlers() method to Logger and LoggerAdapter.
diff --git a/Modules/errnomodule.c b/Modules/errnomodule.c
index 19b8bd5..86720af 100644
--- a/Modules/errnomodule.c
+++ b/Modules/errnomodule.c
@@ -797,6 +797,36 @@ PyInit_errno(void)
#ifdef WSAN
inscode(d, ds, de, "WSAN", WSAN, "Error WSAN");
#endif
+#ifdef ENOMEDIUM
+ inscode(d, ds, de, "ENOMEDIUM", ENOMEDIUM, "No medium found");
+#endif
+#ifdef EMEDIUMTYPE
+ inscode(d, ds, de, "EMEDIUMTYPE", EMEDIUMTYPE, "Wrong medium type");
+#endif
+#ifdef ECANCELED
+ inscode(d, ds, de, "ECANCELED", ECANCELED, "Operation Canceled");
+#endif
+#ifdef ENOKEY
+ inscode(d, ds, de, "ENOKEY", ENOKEY, "Required key not available");
+#endif
+#ifdef EKEYEXPIRED
+ inscode(d, ds, de, "EKEYEXPIRED", EKEYEXPIRED, "Key has expired");
+#endif
+#ifdef EKEYREVOKED
+ inscode(d, ds, de, "EKEYREVOKED", EKEYREVOKED, "Key has been revoked");
+#endif
+#ifdef EKEYREJECTED
+ inscode(d, ds, de, "EKEYREJECTED", EKEYREJECTED, "Key was rejected by service");
+#endif
+#ifdef EOWNERDEAD
+ inscode(d, ds, de, "EOWNERDEAD", EOWNERDEAD, "Owner died");
+#endif
+#ifdef ENOTRECOVERABLE
+ inscode(d, ds, de, "ENOTRECOVERABLE", ENOTRECOVERABLE, "State not recoverable");
+#endif
+#ifdef ERFKILL
+ inscode(d, ds, de, "ERFKILL", ERFKILL, "Operation not possible due to RF-kill");
+#endif
/* Solaris-specific errnos */
#ifdef ECANCELED