Repository navigation
Commit 98b6246
committed
Several changes that Python carry on in the face of errors in the
initialization of class exceptions. Specifically:
init_class_exc(): This function now returns an integer status of the
class exception initialization. No fatal errors in this method now.
Also, use PySys_WriteStderr() when writing error messages. When an
error occurs in this function, 0 is returned, but the partial creation
of the exception classes is not undone (this happens elsewhere).
Things that could trigger the fallback:
- exceptions.py fails to be imported (due to syntax error, etc.)
- one of the exception classes is missing (e.g. due to library
version mismatch)
- exception class can't be inserted into __builtin__'s dictionary
- MemoryError instance can't be pre-allocated
- some other PyErr_Occurred
newstdexception(): Changed the error message. This is still a fatal
error because if the string based exceptions can't be created, we
really can't continue.
initerrors(): Be sure to xdecref the .exc field, which might be
non-NULL if class exceptions init was aborted.
_PyBuiltin_Init_2(): If class exception init fails, print a warning
message and reinstate the string based exceptions.1 parent d24d3fc commit 98b6246
1 file changed
Lines changed: 61 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1987 | 1987 | | |
1988 | 1988 | | |
1989 | 1989 | | |
1990 | | - | |
1991 | | - | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
1992 | 1995 | | |
1993 | 1996 | | |
1994 | 1997 | | |
1995 | 1998 | | |
1996 | 1999 | | |
1997 | | - | |
1998 | | - | |
| 2000 | + | |
| 2001 | + | |
1999 | 2002 | | |
| 2003 | + | |
2000 | 2004 | | |
2001 | 2005 | | |
2002 | 2006 | | |
2003 | | - | |
2004 | | - | |
| 2007 | + | |
2005 | 2008 | | |
2006 | | - | |
2007 | | - | |
| 2009 | + | |
2008 | 2010 | | |
2009 | 2011 | | |
2010 | 2012 | | |
2011 | | - | |
2012 | | - | |
2013 | | - | |
| 2013 | + | |
2014 | 2014 | | |
2015 | | - | |
2016 | | - | |
| 2015 | + | |
2017 | 2016 | | |
2018 | 2017 | | |
2019 | 2018 | | |
2020 | 2019 | | |
2021 | | - | |
2022 | | - | |
2023 | | - | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
2024 | 2027 | | |
2025 | 2028 | | |
2026 | 2029 | | |
2027 | 2030 | | |
2028 | 2031 | | |
2029 | 2032 | | |
2030 | 2033 | | |
2031 | | - | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
2032 | 2040 | | |
2033 | 2041 | | |
2034 | 2042 | | |
2035 | 2043 | | |
2036 | | - | |
2037 | | - | |
2038 | | - | |
2039 | | - | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
2040 | 2050 | | |
| 2051 | + | |
2041 | 2052 | | |
2042 | 2053 | | |
2043 | 2054 | | |
2044 | 2055 | | |
2045 | | - | |
2046 | | - | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
2047 | 2072 | | |
2048 | 2073 | | |
2049 | 2074 | | |
| |||
2062 | 2087 | | |
2063 | 2088 | | |
2064 | 2089 | | |
2065 | | - | |
| 2090 | + | |
2066 | 2091 | | |
2067 | 2092 | | |
2068 | 2093 | | |
| |||
2073 | 2098 | | |
2074 | 2099 | | |
2075 | 2100 | | |
| 2101 | + | |
2076 | 2102 | | |
2077 | 2103 | | |
2078 | 2104 | | |
| |||
2166 | 2192 | | |
2167 | 2193 | | |
2168 | 2194 | | |
2169 | | - | |
2170 | | - | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
2171 | 2206 | | |
2172 | 2207 | | |
2173 | 2208 | | |
| |||
0 commit comments