summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
Commit message (Collapse)AuthorAgeFilesLines
* Replace IOError with OSError (#16715)Andrew Svetlov2012-12-251-4/+4
|
* Get rig of EnvironmentError (#16705)Andrew Svetlov2012-12-171-3/+3
|
* merge 3.3Philip Jenvey2012-11-141-5/+10
|\
| * merge 3.2Philip Jenvey2012-11-141-5/+10
| |\
| | * don't gc_collect on CPython to guarantee a lack of ref cycles (thanks Antoine)Philip Jenvey2012-11-141-5/+9
| | |
* | | merge 3.3Philip Jenvey2012-11-131-0/+3
|\ \ \ | |/ /
| * | merge 3.2Philip Jenvey2012-11-131-0/+3
| |\ \ | | |/
| | * add gc_collects to weakref testsPhilip Jenvey2012-11-131-0/+3
| | |
* | | Clean up some warnings in test suite output.Nadeem Vawda2012-10-131-4/+5
|/ /
* | Issue #15784: Modify OSError.__str__() to better distinguish betweenRichard Oudkerk2012-08-281-2/+2
| | | | | | | | errno error numbers and Windows error numbers.
* | Issue #15778: Coerce ImportError.args to a string when it isn'tBrett Cannon2012-08-241-0/+5
| | | | | | | | | | | | already one. Patch by Dave Malcolm.
* | Issue #1692335: Move initial args assignment to BaseException.__new__Richard Oudkerk2012-07-281-1/+15
| | | | | | | | to help pickling of naive subclasses.
* | PEP 415: Implement suppression of __context__ display with an exception ↵Benjamin Peterson2012-05-151-7/+8
| | | | | | | | | | | | attribute This replaces the original PEP 409 implementation. See #14133.
* | Issue #1559549: Add 'name' and 'path' attributes to ImportError.Brett Cannon2012-04-131-1/+23
| | | | | | | | | | | | | | | | Currently import does not use these attributes as they are planned for use by importlib (which will be another commit). Thanks to Filip Gruszczyński for the initial patch and Brian Curtin for refining it.
* | - Issue #14177: marshal.loads() now raises TypeError when given an unicodeAntoine Pitrou2012-03-031-1/+1
|\ \ | |/ | | | | string. Patch by Guilherme Gonçalves.
| * Issue #14177: marshal.loads() now raises TypeError when given an unicode string.Antoine Pitrou2012-03-031-1/+1
| | | | | | | | Patch by Guilherme Gonçalves.
* | Close issue #6210: Implement PEP 409Nick Coghlan2012-02-261-6/+23
| |
* | PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy.Antoine Pitrou2011-10-121-9/+34
| |
* | Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is nowAntoine Pitrou2011-09-011-0/+8
|\ \ | |/ | | | | mapped to POSIX errno ENOTDIR (previously EINVAL).
| * Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is nowAntoine Pitrou2011-09-011-0/+8
| | | | | | | | mapped to POSIX errno ENOTDIR (previously EINVAL).
* | Issue #12791: Break reference cycles early when a generator exits with an ↵Antoine Pitrou2011-08-201-0/+62
|\ \ | |/ | | | | exception.
| * Issue #12791: Break reference cycles early when a generator exits with an ↵Antoine Pitrou2011-08-201-0/+62
| | | | | | | | exception.
* | merge 3.2Benjamin Peterson2011-07-031-0/+12
|\ \ | |/
| * never retain a generator's caller's exception state on the generator after a ↵Benjamin Peterson2011-07-031-0/+12
| | | | | | | | | | | | | | yield/return This requires some trickery to properly save the exception state if the generator creates its own exception state.
* | merge 3.2 (#12475)Benjamin Peterson2011-07-031-0/+15
|\ \ | |/
| * restore a generator's caller's exception state both on yield and (last) returnBenjamin Peterson2011-07-031-0/+15
| | | | | | | | | | | | This prevents generator exception state from leaking into the caller. Closes #12475.
* | Issue #10990: Prevent tests from clobbering a set trace function.Brett Cannon2011-02-211-1/+4
|/ | | | | | | | | | | Many tests simply didn't care if they unset a pre-existing trace function. This made test coverage impossible. This patch fixes various tests to put back any pre-existing trace function. It also introduces test.support.no_tracing as a decorator which will temporarily unset the trace function for tests which simply fail otherwise. Thanks to Kristian Vlaardingerbroek for helping to find the cause of various trace function unsets.
* #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-30/+29
|
* Issue #5437: A preallocated MemoryError instance should not hold tracebackAntoine Pitrou2010-10-281-0/+39
| | | | data (including local variables caught in the stack trace) alive infinitely.
* #4617: Previously it was illegal to delete a name from the localAmaury Forgeot d'Arc2010-09-101-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | namespace if it occurs as a free variable in a nested block. This limitation of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF). This sample was valid in 2.6, but fails to compile in 3.x without this change:: >>> def f(): ... def print_error(): ... print(e) ... try: ... something ... except Exception as e: ... print_error() ... # implicit "del e" here This sample has always been invalid in Python, and now works:: >>> def outer(x): ... def inner(): ... return x ... inner() ... del x There is no need to bump the PYC magic number: the new opcode is used for code that did not compile before.
* Merged revisions 82330 via svnmerge fromBenjamin Peterson2010-06-281-1/+3
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r82330 | benjamin.peterson | 2010-06-28 10:36:40 -0500 (Mon, 28 Jun 2010) | 1 line testcapi tests are definitely cpython only ........
* prevent generator finalization from invalidating sys.exc_info() #7173Benjamin Peterson2010-03-071-1/+16
|
* Merged revisions 78418 via svnmerge fromEric Smith2010-02-241-0/+36
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78418 | eric.smith | 2010-02-24 09:15:36 -0500 (Wed, 24 Feb 2010) | 1 line Issue #7309: Unchecked pointer access when converting UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings. ........
* Merged revisions 77727 via svnmerge fromEzio Melotti2010-01-241-3/+3
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77727 | ezio.melotti | 2010-01-24 18:58:36 +0200 (Sun, 24 Jan 2010) | 1 line use assert[Not]IsInstance where appropriate ........
* use assert[Not]In where appropriateEzio Melotti2010-01-231-1/+1
|
* use assert[Not]In where appropriateBenjamin Peterson2010-01-191-2/+2
| | | | A patch from Dave Malcolm.
* Merged revisions 77088 via svnmerge fromGeorg Brandl2009-12-281-0/+40
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77088 | georg.brandl | 2009-12-28 09:34:58 +0100 (Mo, 28 Dez 2009) | 1 line #7033: add new API function PyErr_NewExceptionWithDoc, for easily giving new exceptions a docstring. ........
* Remove test for unicode(e) converted to str(e) by 2to3Ezio Melotti2009-12-241-5/+3
|
* convert old fail* assertions to assert*Benjamin Peterson2009-06-301-25/+25
|
* Fix segfaults when running test_exceptions with coverage tracing, caused by ↵Georg Brandl2009-03-311-0/+6
| | | | wrongly defining Exception.__context__ as a T_OBJECT structmember which does not set the member to NULL on None assignment, and generally does not do type checks. This could be used to crash the interpreter by setting any object to __context__. The same applies to __cause__. Also document the PyException_* functions.
* Issue #2534: speed up isinstance() and issubclass() by 50-70%, so as toAntoine Pitrou2008-08-261-5/+11
| | | | | | | | | | match Python 2.5 speed despite the __instancecheck__ / __subclasscheck__ mechanism. In the process, fix a bug where isinstance() and issubclass(), when given a tuple of classes as second argument, were looking up __instancecheck__ / __subclasscheck__ on the tuple rather than on each type object. Reviewed by Benjamin Peterson and Raymond Hettinger.
* move test to a better locationBenjamin Peterson2008-08-211-21/+0
|
* apply a fix for #3611 where the current exception context was deleted with a ↵Benjamin Peterson2008-08-201-0/+22
| | | | generator causing a segfault
* add _testcapi.raise_memoryerror to make test_exceptions.test_MemoryError simplerBenjamin Peterson2008-08-161-1/+2
|
* Merged revisions 65339-65340,65342 via svnmerge fromAmaury Forgeot d'Arc2008-08-011-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r65339 | amaury.forgeotdarc | 2008-07-31 23:28:03 +0200 (jeu., 31 juil. 2008) | 5 lines #3479: unichr(2**32) used to return u'\x00'. The argument was fetched in a long, but PyUnicode_FromOrdinal takes an int. (why doesn't gcc issue a truncation warning in this case?) ........ r65340 | amaury.forgeotdarc | 2008-07-31 23:35:03 +0200 (jeu., 31 juil. 2008) | 2 lines Remove a dummy test that was checked in by mistake ........ r65342 | amaury.forgeotdarc | 2008-08-01 01:39:05 +0200 (ven., 01 août 2008) | 8 lines Correct a crash when two successive unicode allocations fail with a MemoryError: the freelist contained half-initialized objects with freed pointers. The comment /* XXX UNREF/NEWREF interface should be more symmetrical */ was copied from tupleobject.c, and appears in some other places. I sign the petition. ........
* Correct one of the "MemoryError oddities":Amaury Forgeot d'Arc2008-07-311-0/+18
| | | | the traceback would grow each time a MemoryError is raised.
* Merged revisions 65320 via svnmerge fromBenjamin Peterson2008-07-311-2/+33
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r65320 | amaury.forgeotdarc | 2008-07-30 19:42:16 -0500 (Wed, 30 Jul 2008) | 3 lines #2542: now that issubclass() may call arbitrary code, make sure that PyErr_ExceptionMatches returns 0 when an exception occurs there. ........
* improvements to the fix for #3114Benjamin Peterson2008-06-151-9/+4
| | | | keep the tstate consistent and a better test
* #3114 fix a bus error when deallocated exceptions were usedBenjamin Peterson2008-06-151-0/+19
|
* Implicit exception chaining via __context__ (PEP 3134).Guido van Rossum2008-06-141-1/+6
| | | | Patch 3108 by Antooine Pitrou.