summaryrefslogtreecommitdiff
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index b82b6ba87f..5715b26fa7 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -1852,6 +1852,7 @@ SimpleExtendsException(PyExc_Warning, UnicodeWarning,
"Base class for warnings about Unicode related problems, mostly\n"
"related to conversion problems.");
+
/*
* BytesWarning extends Warning
*/
@@ -1860,6 +1861,13 @@ SimpleExtendsException(PyExc_Warning, BytesWarning,
"related to conversion from str or comparing to str.");
+/*
+ * ResourceWarning extends Warning
+ */
+SimpleExtendsException(PyExc_Warning, ResourceWarning,
+ "Base class for warnings about resource usage.");
+
+
/* Pre-computed MemoryError instance. Best to create this as early as
* possible and not wait until a MemoryError is actually raised!
@@ -1939,6 +1947,7 @@ _PyExc_Init(void)
PRE_INIT(ImportWarning)
PRE_INIT(UnicodeWarning)
PRE_INIT(BytesWarning)
+ PRE_INIT(ResourceWarning)
bltinmod = PyImport_ImportModule("builtins");
if (bltinmod == NULL)
@@ -2001,6 +2010,7 @@ _PyExc_Init(void)
POST_INIT(ImportWarning)
POST_INIT(UnicodeWarning)
POST_INIT(BytesWarning)
+ POST_INIT(ResourceWarning)
PyExc_MemoryErrorInst = BaseException_new(&_PyExc_MemoryError, NULL, NULL);
if (!PyExc_MemoryErrorInst)