Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 31c604d

Browse files
committed
Issue 9916: Add some missing errno symbols.
1 parent 0258ce8 commit 31c604d

3 files changed

Lines changed: 36 additions & 3 deletions

File tree

Lib/test/test_errno.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def test_for_improper_attributes(self):
2020
def test_using_errorcode(self):
2121
# Every key value in errno.errorcode should be on the module.
2222
for value in errno.errorcode.values():
23-
self.assertTrue(hasattr(errno, value), 'no %s attr in errno' % value)
23+
self.assertTrue(hasattr(errno, value),
24+
'no %s attr in errno' % value)
2425

2526

2627
class ErrorcodeTests(unittest.TestCase):

Misc/NEWS

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Core and Builtins
1414
threads are still running. Instead, reinitialize the GIL on a second call to
1515
Py_Initialize().
1616

17-
- All SyntaxErrors now have a column offset and therefore a caret when the error
18-
is printed.
17+
- All SyntaxErrors now have a column offset and therefore a caret when the
18+
error is printed.
1919

2020
- Issue #9252: PyImport_Import no longer uses a fromlist hack to return the
2121
module that was imported, but instead gets the module from sys.modules.
@@ -62,6 +62,8 @@ Core and Builtins
6262
Library
6363
-------
6464

65+
- Issue #9916: Add some missing errno symbols.
66+
6567
- Issue #9877: Expose sysconfig.get_makefile_filename()
6668

6769
- logging: Added hasHandlers() method to Logger and LoggerAdapter.

Modules/errnomodule.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,36 @@ PyInit_errno(void)
797797
#ifdef WSAN
798798
inscode(d, ds, de, "WSAN", WSAN, "Error WSAN");
799799
#endif
800+
#ifdef ENOMEDIUM
801+
inscode(d, ds, de, "ENOMEDIUM", ENOMEDIUM, "No medium found");
802+
#endif
803+
#ifdef EMEDIUMTYPE
804+
inscode(d, ds, de, "EMEDIUMTYPE", EMEDIUMTYPE, "Wrong medium type");
805+
#endif
806+
#ifdef ECANCELED
807+
inscode(d, ds, de, "ECANCELED", ECANCELED, "Operation Canceled");
808+
#endif
809+
#ifdef ENOKEY
810+
inscode(d, ds, de, "ENOKEY", ENOKEY, "Required key not available");
811+
#endif
812+
#ifdef EKEYEXPIRED
813+
inscode(d, ds, de, "EKEYEXPIRED", EKEYEXPIRED, "Key has expired");
814+
#endif
815+
#ifdef EKEYREVOKED
816+
inscode(d, ds, de, "EKEYREVOKED", EKEYREVOKED, "Key has been revoked");
817+
#endif
818+
#ifdef EKEYREJECTED
819+
inscode(d, ds, de, "EKEYREJECTED", EKEYREJECTED, "Key was rejected by service");
820+
#endif
821+
#ifdef EOWNERDEAD
822+
inscode(d, ds, de, "EOWNERDEAD", EOWNERDEAD, "Owner died");
823+
#endif
824+
#ifdef ENOTRECOVERABLE
825+
inscode(d, ds, de, "ENOTRECOVERABLE", ENOTRECOVERABLE, "State not recoverable");
826+
#endif
827+
#ifdef ERFKILL
828+
inscode(d, ds, de, "ERFKILL", ERFKILL, "Operation not possible due to RF-kill");
829+
#endif
800830

801831
/* Solaris-specific errnos */
802832
#ifdef ECANCELED

0 commit comments

Comments
 (0)