| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
This was added for (some) Windows buildbots back in 2012, and should
either not be necessary anymore, or it should probably get investigated
why "\*.*" gets added to filenames in the first place.
Ref:
Automerge-Triggered-By: GH:hynek
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Tkinter functions and constructors which need a default root window
raise now RuntimeError with descriptive message instead of obscure
AttributeError or NameError if it is not created yet or cannot
be created automatically.
* Add tests for all functions which use default root window.
* Fix import in the pynche script.
|
|
|
|
| |
(GH-23665)
|
| |
|
|
|
|
|
| |
zipimport's _unmarshal_code swallows import errors and then _get_module_code doesn't know the cause of the error, and returns the generic, and sometimes incorrect, 'could not find...'.
Automerge-Triggered-By: GH:brettcannon
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* bpo-42199: Fix bytecode_helper assertNotInBytecode
Add tests.
* 📜🤖 Added by blurb_it.
Co-authored-by: Dino Viehland <dinoviehland@fb.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
after raising or reraising an exception (GH-23803)
* Ensure that f_lasti is set correctly after an exception is raised to conform to PEP 626.
* Update importlib
* Add NEWS.
|
| |
|
|
|
| |
The quoted sentence can be found from the last paragraph of RFC 2046, Section 5.1, while the content of RFC 2026 is unrelated to this module.
|
|
|
| |
Regression in 8d59eb1b66c51b2b918da9881c57d07d08df43b7.
|
|
|
| |
This is a trivial refactor in preparation for a fix for bpo-38323.
|
|
|
|
|
|
|
|
|
| |
exiting via a finally block. (GH-23780)
* Make sure that return/break/continue are only traced once when exiting via a finally block.
* Add test for return in try-finally.
* Update importlib
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-23733)
* Delete jump instructions that bypass empty blocks
* Add news entry
* Explicitly check for unconditional jump opcodes
Using the is_jump function results in the inclusion of instructions like
returns for which this optimization is not really valid. So, instead
explicitly check that the instruction is an unconditional jump.
* Handle conditional jumps, delete jumps gracefully
* Ensure b_nofallthrough and b_reachable are valid
* Add test for redundant jumps
* Regenerate importlib.h and edit Misc/ACKS
* Fix bad whitespace
|
|
|
|
|
| |
test_unix_events.py no longer checks if waitstatus_to_exitcode() mock
has been called or not to make the test more functional, rather than
checking the exact implementation.
|
| |
|
|
|
| |
Use shorter timeout and replace send() with sendall().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-42644: Validate values in logging.disable()
Technically make the value of manager a property that checks and convert
values assigned to it properly. This has the side effect of making
`logging.disable` also accept strings representing the various level of
warnings.
We want to validate the type of the disable attribute at assignment
time, as it is later compared to other levels when emitting warnings and
would generate a `TypeError: '>=' not supported between ....` in a
different part of the code base, which can make it difficult to track
down.
When assigned an incorrect value; it will raise a TypeError when the
wrong type, or ValueError if an invalid str.
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
|
|
|
| |
Automerge-Triggered-By: GH:jaraco
|
| |
|
|
|
|
| |
VxWorks (GH-23716)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Enhance test_select.test_select(): it now takes 500 ms rather than 10
seconds.
* Use Python rather than a shell as the child process to make the
test more portable.
* Use a sleep of 50 ms per line rather than 1 second.
* Use subprocess.Popen rather than os.popen().
|
|
|
|
|
|
|
|
|
|
| |
atexit._run_exitfuncs() now logs callback exceptions using
sys.unraisablehook, rather than logging them directly into
sys.stderr and raising the last exception.
Run GeneralTest of test_atexit in a subprocess since it calls
atexit._clear() which clears all atexit callbacks.
_PyAtExit_Fini() sets state->callbacks to NULL.
|
|
|
|
|
|
| |
* Add run_test_script() function to test.support.script_helper.
* Rename Lib/test/eintrdata/eintr_tester.py to
Lib/test/_test_eintr.py.
* test_eintr.py uses run_test_script().
|
|
|
|
|
|
|
|
|
| |
* Add _PyAtExit_Call() function and remove pyexitfunc and
pyexitmodule members of PyInterpreterState. The function
logs atexit callback errors using _PyErr_WriteUnraisableMsg().
* Add _PyAtExit_Init() and _PyAtExit_Fini() functions.
* Remove traverse, clear and free functions of the atexit module.
Co-authored-by: Dong-hee Na <donghee.na@python.org>
|
|
|
|
| |
statements conform to PEP 626. (GH-23743)
|
|
|
| |
Add sentence to module docstring and import tkinter items.
|
|
|
|
|
|
|
|
|
|
|
| |
At Python exit, if a callback registered with atexit.register()
fails, its exception is now logged. Previously, only some exceptions
were logged, and the last exception was always silently ignored.
Add _PyAtExit_Call() function and remove
PyInterpreterState.atexit_func member. call_py_exitfuncs() now calls
directly _PyAtExit_Call().
The atexit module must now always be built as a built-in module.
|
|
|
|
|
|
|
|
|
| |
* Rename "atexitmodule_state" to "struct atexit_state".
* Rename "modstate" to "state".
* Rename "self" parameter to "module".
* test_atexit uses textwrap.dedent().
* Remove _Py_PyAtExit() function: inline it into atexit_exec().
* PyInterpreterState: rename pyexitfunc to atexit_func, rename
pyexitmodule to atexit_module.
|
|
|
|
|
|
|
|
|
|
|
|
| |
patch, patch.object and create_autospec silently ignore misspelled
arguments such as autospect, auto_spec and set_spec. This can lead
to tests failing to check what they are supposed to check.
This change adds a check causing a RuntimeError if the above
functions get any of the above misspellings as arguments. It also
adds a new argument, "unsafe", which can be set to True to disable
this check.
Also add "!r" to format specifiers in added error messages.
|
|
|
|
|
|
|
|
|
| |
Add positional only args support to lib2to3 pgen2.
This adds 3.8's PEP-570 support to lib2to3's pgen2. lib2to3, while
being deprecated is still used by things to parse all versions of Python
code today. We need it to support parsing modern 3.8 and 3.9 constructs.
Also add tests for complex *expr and **expr's.
|
|
|
|
| |
spurious line events. (GH-23761)
|
| |
|
|
|
|
| |
typing (GH-23060)
|
|
|
| |
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
|
|
|
|
| |
- `from None` if the new exception uses, or doesn't need, the previous one
- `from e` if the previous exception is still relevant
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows easier Enum construction in unusual cases, such as including dynamic member definitions into a class definition:
# created dynamically
foo_defines = {'FOO_CAT': 'aloof', 'BAR_DOG': 'friendly', 'FOO_HORSE': 'big'}
class Foo(Enum):
vars().update({
k: v
for k, v in foo_defines.items()
if k.startswith('FOO_')
})
def upper(self):
# example method
return self.value.upper()
|
|
|
| |
The default for auto() is to return an integer, which doesn't work for `StrEnum`. The new `_generate_next_value_` for `StrEnum` returns the member name, lower cased.
|
|
|
|
|
|
|
|
|
| |
This is a follow-up to
https://github.com/python/cpython/commit/4662fa9bfe4a849fe87bfb321d8ef0956c89a772.
That original commit expanded guards against misspelling assertions on
mocks. This follow-up updates the documentation and improves the error
message by pointing out the potential cause and solution.
Automerge-Triggered-By: GH:gpshead
|
|
|
| |
private names, such as `_Color__hue` and `_Color__hue_` are now normal attributes, and do not become members nor raise exceptions
|
|
|
|
|
| |
When creating an Enum, type.__new__ calls __init_subclass__, but at that point the members have not been added.
This patch suppresses the initial call, then manually calls the ancestor __init_subclass__ before returning the new Enum class.
|
|
|
|
| |
(GH-21684)
|
| |
|
| |
|