summaryrefslogtreecommitdiff
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* bpo-40334: Add support for feature_version in new PEG parser (GH-19827)Lysandros Nikolaou2020-04-301-6/+0
| | | | | | | | | | | | | | | | | | | `ast.parse` and `compile` support a `feature_version` parameter that tells the parser to parse the input string, as if it were written in an older Python version. The `feature_version` is propagated to the tokenizer, which uses it to handle the three different stages of support for `async` and `await`. Additionally, it disallows the following at parser level: - The '@' operator in < 3.5 - Async functions in < 3.5 - Async comprehensions in < 3.6 - Underscores in numeric literals in < 3.6 - Await expression in < 3.5 - Variable annotations in < 3.6 - Async for-loops in < 3.5 - Async with-statements in < 3.5 - F-strings in < 3.6 Closes we-like-parsers/cpython#124.
* bpo-40443: Remove unused imports in stdlib (GH-19815)Victor Stinner2020-05-013-4/+2
|
* bpo-40275: Fix name error in support.socket_helper (GH-19825)Victor Stinner2020-05-011-4/+6
| | | | | Replace TestFailed with support.TestFailed. Bug spotted by pyflakes.
* Remove dead code in test__xxsubinterpreters (GH-19826)Victor Stinner2020-05-011-20/+0
|
* Revert "bpo-29587: Enable implicit exception chaining with gen.throw() ↵Victor Stinner2020-04-301-17/+0
| | | | | (GH-19811)" (#19821) This reverts commit 2514a632fb7d37be24c2059d0e286d35600f9795.
* bpo-29587: Enable implicit exception chaining with gen.throw() (GH-19811)Chris Jerdonek2020-04-301-0/+17
| | | | | Before this commit, if an exception was active inside a generator when calling gen.throw(), then that exception was lost (i.e. there was no implicit exception chaining). This commit fixes that.
* bpo-40334: Support type comments (GH-19780)Guido van Rossum2020-04-301-1/+6
| | | | | | | | | | This implements full support for # type: <type> comments, # type: ignore <stuff> comments, and the func_type parsing mode for ast.parse() and compile(). Closes https://github.com/we-like-parsers/cpython/issues/95. (For now, you need to use the master branch of mypy, since another issue unique to 3.9 had to be fixed there, and there's no mypy release yet.) The only thing missing is `feature_version=N`, which is being tracked in https://github.com/we-like-parsers/cpython/issues/124.
* compileall: Fix typos in docstring (GH-19810)Jelle Zijlstra2020-04-301-2/+2
|
* bpo-40443: Remove unused imports in distutils (GH-19802)Victor Stinner2020-04-3011-17/+6
|
* bpo-40443: Remove unused imports in the stdlib (GH-19803)Victor Stinner2020-04-3010-12/+0
|
* bpo-40394 - difflib.SequenceMatched.find_longest_match default args (GH-19742)lrjball2020-04-292-3/+55
| | | | | * bpo-40394 - difflib.SequenceMatched.find_longest_match default args Added default args to find_longest_match, as well as related tests.
* bpo-40443: Remove unused imports in idlelib (GH-19801)Victor Stinner2020-04-296-6/+3
|
* bpo-40389: Improve repr of typing.Optional (#19714)Vlad Serebrennikov2020-04-293-2/+9
|
* bpo-40443: Remove unused imports in tests (GH-19804)Victor Stinner2020-04-3018-20/+2
|
* bpo-40443: Remove unused imports in tests (GH-19805)Victor Stinner2020-04-3017-20/+4
|
* bpo-40334: Fix test_peg_parser to actually use the old parser (GH-19778)Lysandros Nikolaou2020-04-291-5/+4
| | | Now that the default parser is the new PEG parser, ast.parse uses it, which means that we don't actually test something in test_peg_parser. This commit introduces a new keyword argument (`oldparser`) for `_peg_parser.parse_string` for specifying that a string needs to be parsed with the old parser. This keyword argument is used in the tests to actually compare the ASTs the new parser generates with those generated by the old parser.
* bpo-40291: Add support for CAN_J1939 sockets (GH-19538)karl ding2020-04-291-0/+74
| | | | Add support for CAN_J1939 sockets that wrap SAE J1939 protocol functionality provided by Linux 5.4+ kernels.
* bpo-40286: Remove C implementation of Random.randbytes() (GH-19797)Victor Stinner2020-04-291-0/+6
| | | | | Remove _random.Random.randbytes(): the C implementation of randbytes(). Implement the method in Python to ease subclassing: randbytes() now directly reuses getrandbits().
* bpo-9216: Expose OpenSSL FIPS_mode() as _hashlib.get_fips_mode() (GH-19703)Victor Stinner2020-04-292-0/+25
| | | | | | test.pythoninfo logs OpenSSL FIPS_mode() and Linux /proc/sys/crypto/fips_enabled in a new "fips" section. Co-Authored-By: Petr Viktorin <encukou@gmail.com>
* bpo-40228: More robust frame.setlineno. (GH-19437)Mark Shannon2020-04-291-18/+17
| | | More robust frame.setlineno. Makes no assumptions about source->bytecode translation.
* bpo-40436: Fix code parsing gdb version (GH-19792)Victor Stinner2020-04-292-2/+11
| | | test_gdb and test.pythoninfo now check gdb command exit code.
* Add missing sys import to socket_helper.py (GH-19791)Pablo Galindo2020-04-291-0/+1
|
* bpo-40275: Move transient_internet from test.support to socket_helper (GH-19711)Serhiy Storchaka2020-04-2914-137/+145
|
* bpo-40334: Disallow invalid single statements in the new parser (GH-19774)Lysandros Nikolaou2020-04-291-1/+0
| | | | | After parsing is done in single statement mode, the tokenizer buffer has to be checked for additional lines and a `SyntaxError` must be raised, in case there are any. Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-39995: Fix concurrent.futures _ThreadWakeup (GH-19760)Victor Stinner2020-04-291-14/+27
| | | | Fix a race condition in concurrent.futures._ThreadWakeup: access to _ThreadWakeup is now protected with the shutdown lock.
* bpo-40275: Move requires_hashdigest() to test.support.hashlib_helper (GH-19716)Hai Shi2020-04-299-68/+71
| | | Add a new test.support.hashlib_helper submodule.
* bpo-40334: Fix shifting of nested f-strings in the new parser (GH-19771)Lysandros Nikolaou2020-04-291-2/+1
| | | `JoinedStr`s and `FormattedValue also needs to be shifted, in order to correctly compute the location information of nested f-strings.
* bpo-38880: List interpreters associated with a channel end (GH-17323)Lewis Gaul2020-04-281-0/+196
| | | | | This PR adds the functionality requested by https://github.com/ericsnowcurrently/multi-core-python/issues/52. Automerge-Triggered-By: @ericsnowcurrently
* bpo-40431: Fix syntax typo in turtledemo (GH-19777)Miro Hrončok2020-04-291-1/+1
| | | | | | *** File "/usr/lib64/python3.9/turtledemo/__main__.py", line 275 bg="#d00" if clear == NORMAL else"#fca") ^ SyntaxError: invalid string prefix
* bpo-32604: Add support for a "default" arg in channel_recv(). (GH-19770)Eric Snow2020-04-281-0/+21
| | | | | This allows the caller to avoid creation of an exception when the channel is empty (just like `dict.get()` works). `ChannelEmptyError` is still raised if no default is provided. Automerge-Triggered-By: @ericsnowcurrently
* bpo-39966: Revert "bpo-25597: Ensure wraps' return value is used for magic ↵Karthikeyan Singaravelan2020-04-282-12/+10
| | | | | | | methods in MagicMock" (GH-19734) * Revert "bpo-25597: Ensure wraps' return value is used for magic methods in MagicMock (#16029)" This reverts commit 72b1004657e60c900e4cd031b2635b587f4b280e.
* bpo-40025: Require _generate_next_value_ to be defined before members (GH-19098)Ethan Onstott2020-04-282-0/+15
| | | require `_generate_next_value_` to be defined before members
* Merge tag 'v3.9.0a6'Łukasz Langa2020-04-281-34/+99
|\
| * Python 3.9.0a6v3.9.0a6Łukasz Langa2020-04-271-34/+99
| |
* | bpo-40334: Don't skip test_parser:test_trigget_memory_error (GH-19744)Lysandros Nikolaou2020-04-281-1/+0
| | | | | | This test has been changed to always use the old parser, so no need for it to be skipped.
* | bpo-40334: Catch E_EOF error, when the tokenizer returns ERRORTOKEN (GH-19743)Lysandros Nikolaou2020-04-281-2/+0
| | | | | | An E_EOF error was only being caught after the parser exited before this commit. There are some cases though, where the tokenizer returns ERRORTOKEN *and* has set an E_EOF error (like when EOF directly follows a line continuation character) which weren't correctly handled before.
* | bpo-39995: Split test_concurrent_futures.test_crash() into sub-tests (GH-19739)Victor Stinner2020-04-271-63/+85
| | | | | | | | | | | | | | | | | | Now only test_error_during_result_unpickle_in_result_handler() captures and ignores sys.stderr in the test process. Tools like test.bisect_cmd don't support subTest() but only work with the granularity of one method. Remove unused ExecutorDeadlockTest._sleep_id() method.
* | bpo-30966: concurrent.futures.Process.shutdown() closes queue (GH-19738)Victor Stinner2020-04-271-0/+2
| | | | | | | | Process.shutdown(wait=True) of concurrent.futures now closes explicitly the result queue.
* | bpo-40334: Support PyPARSE_DONT_IMPLY_DEDENT in the new parser (GH-19736)Pablo Galindo2020-04-271-1/+0
| |
* | bpo-40334: Support CO_FUTURE_BARRY_AS_BDFL in the new parser (GH-19721)Pablo Galindo2020-04-271-6/+10
| | | | | | This commit also allows to pass flags to the new parser in all interfaces and fixes a bug in the parser generator that was causing to inline rules with actions, making them disappear.
* | bpo-30966: Add multiprocessing.SimpleQueue.close() (GH-19735)Victor Stinner2020-04-272-0/+18
| | | | | | | | | | | | Add a new close() method to multiprocessing.SimpleQueue to explicitly close the queue. Automerge-Triggered-By: @pitrou
* | bpo-40375: Implement imaplib.IMAP4.unselect (GH-19712)Dong-hee Na2020-04-272-0/+42
|/
* bpo-40398: Fix typing.get_args() for special generic aliases. (GH-19720)Serhiy Storchaka2020-04-272-3/+10
|
* bpo-40396: Support GenericAlias in the typing functions. (GH-19718)Serhiy Storchaka2020-04-262-6/+59
|
* Fix typo in Lib/typing.py (GH-19717)Nickolena Fisher2020-04-261-1/+1
|
* bpo-40275: Avoid importing logging in test.support (GH-19601)Serhiy Storchaka2020-04-255-104/+103
| | | | | Import logging lazily in assertLogs() in unittest. Move TestHandler from test.support to logging_helper.
* bpo-40275: Avoid importing socket in test.support (GH-19603)Serhiy Storchaka2020-04-2536-370/+401
| | | | | | * Move socket related functions from test.support to socket_helper. * Import socket, nntplib and urllib.error lazily in transient_internet(). * Remove importing multiprocess.
* bpo-40275: Avoid importing asyncio in test.support (GH-19600)Serhiy Storchaka2020-04-252-2/+17
| | | | | * Import asyncio lazily in unittest (only when IsolatedAsyncioTestCase is used). * Import asyncio.events lazily in test.support.
* bpo-40360: Deprecate lib2to3 module in light of PEP 617 (GH-19663)Carl Meyer2020-04-242-1/+9
| | | | | Deprecate lib2to3 module in light of PEP 617. We anticipate removal in the 3.12 timeframe.
* bpo-40334: Rewrite test_c_parser to avoid memory leaks (GH-19694)Lysandros Nikolaou2020-04-241-80/+144
| | | | | | | | | | Previously every test was building an extension module and loading it into sys.modules. The tearDown function was thus not able to clean up correctly, resulting in memory leaks. With this commit, every test function now builds the extension module and runs the actual test code in a new process (using assert_python_ok), so that sys.modules stays intact and no memory gets leaked.