Commit Graph

43 Commits

Author SHA1 Message Date
Guido van Rossum
2ac650f385 New version of PyErr_NewException() that is compatible with -X option. 1997-10-03 19:50:55 +00:00
Barry Warsaw
3a74993118 PyErr_NormalizeException(): If the exception's type is a class and the
instance's class is a subclass of this, then use the instance's class
as the exception type.
1997-09-30 15:00:18 +00:00
Guido van Rossum
7617e05a9b New API PyErr_NewException(name, base, dict) to create simple new exceptions. 1997-09-16 18:43:50 +00:00
Barry Warsaw
2d8adff10a PyErr_NoMemory(): If the pre-instantiated memory exception is non-null
(PyExc_MemoryErrorInst) raise this instead of PyExc_MemoryError.  This
only happens when exception classes are enabled (e.g. when Python is
started with -X).
1997-08-29 21:54:35 +00:00
Barry Warsaw
c0dc92af7d Three new C API functions:
- int PyErr_GivenExceptionMatches(obj1, obj2)

  Returns 1 if obj1 and obj2 are the same object, or if obj1 is an
  instance of type obj2, or of a class derived from obj2

- int PyErr_ExceptionMatches(obj)

  Higher level wrapper around PyErr_GivenExceptionMatches() which uses
  PyErr_Occurred() as obj1.  This will be the more commonly called
  function.

- void PyErr_NormalizeException(typeptr, valptr, tbptr)

  Normalizes exceptions, and places the normalized values in the
  arguments.  If type is not a class, this does nothing.  If type is a
  class, then it makes sure that value is an instance of the class by:

  1. if instance is of the type, or a class derived from type, it does
     nothing.

  2. otherwise it instantiates the class, using the value as an
     argument.  If value is None, it uses an empty arg tuple, and if
     the value is a tuple, it uses just that.
1997-08-22 21:22:58 +00:00
Guido van Rossum
e5b4026881 Use strerror on the mac if using MSL (Jack). 1997-08-12 14:51:52 +00:00
Guido van Rossum
a027efa5bf Massive changes for separate thread state management.
All per-thread globals are moved into a struct which is manipulated
separately.
1997-05-05 20:56:21 +00:00
Guido van Rossum
373c869a6a Quickly renamed. Also removed the long comment explaining why this is
better than the old error API.
1997-04-29 18:22:47 +00:00
Guido van Rossum
7844e38a98 Keep Microsoft VC happy. 1997-04-11 20:44:04 +00:00
Guido van Rossum
6976a52099 (Jack:) On the Mac, use standard strerror() if using MSL C-library. 1997-04-11 19:18:23 +00:00
Guido van Rossum
2dc466169e Oops, remove an unused variable from PyErr_Format(). 1997-02-14 20:57:31 +00:00
Guido van Rossum
1548bacb14 Added convenience function PyErr_Format(exception, formatstring, ...) -> NULL. 1997-02-14 17:09:47 +00:00
Guido van Rossum
067998f35e Add const to error and newstring functions 1996-12-10 15:33:34 +00:00
Guido van Rossum
d266eb460e New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
Guido van Rossum
650ae0ab06 remove unwanted fatal() from err_badcall() 1995-09-18 21:31:16 +00:00
Guido van Rossum
69f6ee6a9d err_badcall() is fatal error 1995-08-28 02:55:48 +00:00
Jack Jansen
eceb3e3f0a Porting to CW CFM68K 1995-06-27 13:15:15 +00:00
Guido van Rossum
53e8d44eec changes in NT tests 1995-03-09 12:11:31 +00:00
Guido van Rossum
e9fbc0992c rename macstrerror to PyMac_StrError; no EINTR test in CW 1995-02-18 14:52:19 +00:00
Jack Jansen
5ef86d55b5 Undef strerror on the mac before redefining it 1995-01-19 12:16:44 +00:00
Guido van Rossum
6d023c98b0 Added 1995 to copyright message.
bltinmodule.c: fixed coerce() nightmare in ternary pow().
modsupport.c (initmodule2): pass METH_FREENAME flag to newmethodobject().
pythonrun.c: move flushline() into and around print_error().
1995-01-04 19:12:13 +00:00
Guido van Rossum
1ae940a587 Lots of changes, most minor (fatal() instead of abort(), use of
err_fetch/err_restore and so on).  But...
NOTE: import.c has been rewritten and all the DL stuff is now in the
new file importdl.c.
1995-01-02 19:04:15 +00:00
Jack Jansen
8fd2d94e37 Added hook for better mac error messages. 1994-12-14 12:54:54 +00:00
Guido van Rossum
c054a663eb call err_clear in err_setval 1994-11-10 22:34:33 +00:00
Guido van Rossum
6989e54ebf * Python/errors.c (err_clear): clear interpreter stack trace 1994-09-29 09:39:39 +00:00