Commit Graph

89 Commits

Author SHA1 Message Date
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
Guido van Rossum 3a24181837 err_clear: clear interpreter stack trace 1994-08-29 12:14:12 +00:00
Guido van Rossum f1dc566328 * Makefile: added all: and default: targets.
* many files: made some functions static; removed "extern int errno;".
* frozenmain.c: fixed bugs introduced on 24 June...
* flmodule.c: remove 1.5 bw compat hacks, add new functions in 2.2a
  (and some old functions that were omitted).
* timemodule.c: added MSDOS floatsleep version .
* pgenmain.c: changed exit() to goaway() and added defn of goaway().
* intrcheck.c: add hack (to UNIX only) so interrupting 3 times
  will exit from a hanging program.  The second interrupt prints
  a message explaining this to the user.
1993-07-05 10:31:29 +00:00
Guido van Rossum e537240c25 * Changed many files to use mkvalue() instead of newtupleobject().
* Fixcprt.py: added [-y file] option, do only files younger than file.
* modsupport.[ch]: added vmkvalue().
* intobject.c: use mkvalue().
* stringobject.c: added "formatstring"; renamed string* to string_*;
  ceval.c: call formatstring for string % value.
* longobject.c: close memory leak in divmod.
* parsetok.c: set result node to NULL when returning an error.
1993-03-16 12:15:04 +00:00
Guido van Rossum bab9d03855 Copyright for 1992 added 1992-04-05 14:26:55 +00:00
Guido van Rossum c4884007f9 EOF in source is a SyntaxError, not an EOFError. 1992-02-05 11:16:47 +00:00
Guido van Rossum 86d8e63433 EOF while parsing should raise EOFError, not SyntaxError. 1991-12-24 13:26:15 +00:00
Guido van Rossum b954c2c39f Use SyntaxError. 1991-12-16 13:05:50 +00:00
Guido van Rossum 87e7ea72a6 Use new exceptions. 1991-12-10 14:00:03 +00:00
Guido van Rossum 5063bab973 Check for EINTR and turn it into KeyboardInterrupt
in err_errno().
1991-10-20 20:14:56 +00:00
Guido van Rossum f70e43a073 Added copyright notice. 1991-02-19 12:39:46 +00:00
Guido van Rossum f22120ab74 Changed include of <errno.h> 1990-12-20 23:05:40 +00:00
Guido van Rossum 3f5da24ea3 "Compiling" version 1990-12-20 15:06:42 +00:00
Guido van Rossum f1ac403c4d Reformulated err_badarg error message. 1990-11-09 15:05:53 +00:00
Guido van Rossum f5401bd49e Added prototype for strerror. 1990-11-02 17:50:28 +00:00
Guido van Rossum 17e66f6d87 Added intobject.h and tupleobject.h includes. 1990-10-26 14:53:07 +00:00
Guido van Rossum 683a072642 Added err_badcall(). 1990-10-21 22:09:12 +00:00
Guido van Rossum 7d310eb081 Adde dconvenience functions. 1990-10-14 20:00:05 +00:00
Guido van Rossum 85a5fbbdfe Initial revision 1990-10-14 12:07:46 +00:00