summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-10-05 21:50:08 (GMT)
committerFred Drake <fdrake@acm.org>2001-10-05 21:50:08 (GMT)
commitbb9fa21cfe7a8343698ce5e26e845b4e0c877d6a (patch)
tree9229be0a614d194fa49a58acdaf9cdee29e47778
parent39c785108f1acddb70930edf023825f935aa640e (diff)
downloadcpython-bb9fa21cfe7a8343698ce5e26e845b4e0c877d6a.zip
cpython-bb9fa21cfe7a8343698ce5e26e845b4e0c877d6a.tar.gz
cpython-bb9fa21cfe7a8343698ce5e26e845b4e0c877d6a.tar.bz2
weakref.ReferenceError becomes a built-in exception now that weak ref objects
are moving into the core; with these changes, it will be possible for the exception to be raised without the weakref module ever being imported.
-rw-r--r--Include/pyerrors.h1
-rw-r--r--Python/exceptions.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index d7b7639..c3960b7 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -48,6 +48,7 @@ extern DL_IMPORT(PyObject *) PyExc_NotImplementedError;
extern DL_IMPORT(PyObject *) PyExc_SyntaxError;
extern DL_IMPORT(PyObject *) PyExc_IndentationError;
extern DL_IMPORT(PyObject *) PyExc_TabError;
+extern DL_IMPORT(PyObject *) PyExc_ReferenceError;
extern DL_IMPORT(PyObject *) PyExc_SystemError;
extern DL_IMPORT(PyObject *) PyExc_SystemExit;
extern DL_IMPORT(PyObject *) PyExc_TypeError;
diff --git a/Python/exceptions.c b/Python/exceptions.c
index ef9d01c..4d17529 100644
--- a/Python/exceptions.c
+++ b/Python/exceptions.c
@@ -97,6 +97,7 @@ Exception\n\
| | |\n\
| | +-- UnicodeError\n\
| |\n\
+ | +-- ReferenceError\n\
| +-- SystemError\n\
| +-- MemoryError\n\
|\n\
@@ -889,6 +890,9 @@ Please report this to the Python maintainer, along with the traceback,\n\
the Python version, and the hardware/OS platform and version.";
static char
+ReferenceError__doc__[] = "Weak ref proxy used after referent went away.";
+
+static char
MemoryError__doc__[] = "Out of memory.";
static char
@@ -956,6 +960,7 @@ PyObject *PyExc_NotImplementedError;
PyObject *PyExc_SyntaxError;
PyObject *PyExc_IndentationError;
PyObject *PyExc_TabError;
+PyObject *PyExc_ReferenceError;
PyObject *PyExc_SystemError;
PyObject *PyExc_SystemExit;
PyObject *PyExc_UnboundLocalError;
@@ -1044,6 +1049,7 @@ static struct {
FloatingPointError__doc__},
{"ValueError", &PyExc_ValueError, 0, ValueError__doc__},
{"UnicodeError", &PyExc_UnicodeError, &PyExc_ValueError, UnicodeError__doc__},
+ {"ReferenceError", &PyExc_ReferenceError, 0, ReferenceError__doc__},
{"SystemError", &PyExc_SystemError, 0, SystemError__doc__},
{"MemoryError", &PyExc_MemoryError, 0, MemoryError__doc__},
/* Warning categories */