summaryrefslogtreecommitdiffstats
path: root/Python
Commit message (Collapse)AuthorAgeFilesLines
* bpo-28936: Detect lexically first syntax error first (#4097)Ivan Levkivskyi2017-10-261-18/+16
| | | | Lexically first global and nonlocal syntax errors at given scope should be detected first.
* Fix trailing whitespaces in C files. (#4130)Serhiy Storchaka2017-10-261-1/+1
|
* bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327)xdegaye2017-10-261-16/+30
|
* bpo-21720: Restore the Python 2.7 logic in handling a fromlist. (#4118)Serhiy Storchaka2017-10-261-1773/+1783
| | | | | | BytesWarning no longer emitted when the fromlist argument of __import__() or the __all__ attribute of the module contain bytes instances.
* bpo-31857: Make the behavior of USE_STACKCHECK deterministic (#4098)pdox2017-10-262-1/+4
|
* remove support for splitting the ceval switch into multiple switches (#4099)Benjamin Peterson2017-10-251-10/+0
| | | | | | | This kludge is from 1992. Any C99 compiler is going to be able to handle the ceval dispatch switch. Anyway, we have much bigger switches than the ceval dispatch one around. (See, e.g., Objects/unicodetype_db.h.)
* bpo-31845: Fix reading flags from environment (GH-4105)Nick Coghlan2017-10-251-14/+23
| | | | | | | | | | The startup refactoring means command line settings are now applied after settings are read from the environment. This updates the way command line settings are applied to account for that, ensures more settings are first read from the environment in _PyInitializeCore, and adds a simple test case covering the flags that are easy to check.
* bpo-30768: Recompute timeout on interrupted lock (GH-4103)Victor Stinner2017-10-242-10/+54
| | | | | | | | | | | | | | | | Fix the pthread+semaphore implementation of PyThread_acquire_lock_timed() when called with timeout > 0 and intr_flag=0: recompute the timeout if sem_timedwait() is interrupted by a signal (EINTR). See also the PEP 475. The pthread implementation of PyThread_acquire_lock() now fails with a fatal error if the timeout is larger than PY_TIMEOUT_MAX, as done in the Windows implementation. The check prevents any risk of overflow in PyThread_acquire_lock(). Add also PY_DWORD_MAX constant.
* bpo-30817: Fix PyErr_PrintEx() when no memory (#2526)xdegaye2017-10-231-3/+9
|
* Move exc state to generator. Fixes bpo-25612 (#1773)Mark Shannon2017-10-224-127/+64
| | | Move exception state information from frame objects to coroutine (generator/thread) object where it belongs.
* bpo-31825: Fixed OverflowError in the 'unicode-escape' codec (#4058)Serhiy Storchaka2017-10-201-1/+1
| | | | and in codecs.escape_decode() when decode an escaped non-ascii byte.
* Move opcode tracing to occur after the possible update to f_lineno. (GH-3798)George King2017-10-191-4/+4
|
* bpo-28603: Fix formatting tracebacks for unhashable exceptions (#4014)Zane Bitter2017-10-171-3/+18
|
* bpo-31786: Make functions in the select module blocking when timeout is a ↵Pablo Galindo2017-10-171-2/+15
| | | | small negative value. (#4003)
* bpo-31773: _PyTime_GetPerfCounter() uses _PyTime_t (GH-3983)Victor Stinner2017-10-162-42/+128
| | | | | | | | * Rewrite win_perf_counter() to only use integers internally. * Add _PyTime_MulDiv() which compute "ticks * mul / div" in two parts (int part and remaining) to prevent integer overflow. * Clock frequency is checked at initialization for integer overflow. * Enhance also pymonotonic() to reduce the precision loss on macOS (mach_absolute_time() clock).
* bpo-31780: Fix incorrect error message for ',x', ',b', ',o' specs (#4002)Dargor2017-10-151-2/+2
| | | Patch by Pablo.
* bpo-31773: time.perf_counter() uses again double (GH-3964)Victor Stinner2017-10-122-21/+27
| | | | | | | | time.clock() and time.perf_counter() now use again C double internally. Remove also _PyTime_GetWinPerfCounterWithInfo(): use _PyTime_GetPerfCounterDoubleWithInfo() instead on Windows.
* Cleanup pytime.c (#3955)Victor Stinner2017-10-111-54/+76
| | | | | * Move _PyTime_overflow() at the top * Move assertion on numerator into _PyTime_ObjectToDenominator() * PEP 7: add { ... } to if blocks
* bpo-31415: Add _PyTime_GetPerfCounter() and use it for -X importtime (#3936)Victor Stinner2017-10-102-12/+73
| | | | | * Add _PyTime_GetPerfCounter() * Use _PyTime_GetPerfCounter() for -X importtime
* bpo-31642: Restore blocking "from" import by setting None in sys.modules. ↵Serhiy Storchaka2017-10-081-242/+244
| | | | (#3834)
* bpo-31709: Update importlib magic (#3906)Yury Selivanov2017-10-061-104/+104
|
* bpo-25658: Implement PEP 539 for Thread Specific Storage (TSS) API (GH-1362)Masayuki Yamamoto2017-10-065-77/+228
| | | | | | | | | See PEP 539 for details. Highlights of changes: - Add Thread Specific Storage (TSS) API - Document the Thread Local Storage (TLS) API as deprecated - Update code that used TLS API to use TSS API
* bpo-31708: Allow async generator expressions in synchronous functions (#3905)Yury Selivanov2017-10-061-1/+1
|
* bpo-31709: Drop support for asynchronous __aiter__. (#3903)Yury Selivanov2017-10-062-51/+7
|
* closes bpo-31696: don't mention GCC in sys.version when building with clang ↵Benjamin Peterson2017-10-061-8/+7
| | | | (#3891)
* bpo-30406: Make async and await proper keywords (#1669)Jelle Zijlstra2017-10-062-190/+198
| | | Per PEP 492, 'async' and 'await' should become proper keywords in 3.7.
* PEP 553 built-in breakpoint() function (bpo-31353) (#3355)Barry Warsaw2017-10-052-0/+103
| | | Implement PEP 553, built-in breakpoint() with support from sys.breakpointhook(), along with documentation and tests. Closes bpo-31353
* remove tabs from getcompiler.c (#3892)Benjamin Peterson2017-10-051-1/+1
|
* bpo-30404: The -u option now makes the stdout and stderr streams totally ↵Serhiy Storchaka2017-10-041-4/+8
| | | | unbuffered. (#1667)
* bpo-31683: Py_FatalError() now supports long error messages (#3878)Victor Stinner2017-10-041-20/+42
| | | | | On Windows, Py_FatalError() now limits the size to 256 bytes of the buffer used to call OutputDebugStringW(). Previously, the size depended on the length of the error message.
* bpo-31415: Add `-X importtime` option (GH-3490)INADA Naoki2017-10-031-0/+42
| | | | | | It shows show import time of each module. It's useful for optimizing startup time. Typical usage: python -X importtime -c 'import requests'
* bpo-31592: Fix an assertion failure in Python parser in case of a bad ↵Oren Milman2017-09-301-12/+16
| | | | unicodedata.normalize(). (#3767)
* bpo-31574: importlib dtrace (#3749)Christian Heimes2017-09-291-0/+10
| | | | | Importlib was instrumented with two dtrace probes to profile import timing. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-31285: Remove splitlines identifier from Python/_warnings.c (#3803)Oren Milman2017-09-291-3/+0
| | | (forgot to remove it in #3219)
* remove support for BSD/OS (closes bpo-31624) (#3812)Benjamin Peterson2017-09-291-21/+0
|
* bpo-31588: Validate return value of __prepare__() methods (GH-3764)Oren Milman2017-09-271-0/+7
| | | | | | | | | | Class execution requires that __prepare__() methods return a proper execution namespace. Check for that immediately after calling __prepare__(), rather than passing it through to the code execution machinery and potentially triggering SystemError (in debug builds) or a cryptic TypeError (in release builds). Patch by Oren Milman.
* bpo-31566: Fix an assertion failure in _warnings.warn() in case of a bad ↵Oren Milman2017-09-241-3/+4
| | | | __name__ global. (#3717)
* bpo-31285: Fix an assertion failure and a SystemError in ↵Oren Milman2017-09-241-3/+1
| | | | warnings.warn_explicit. (#3219)
* bpo-31315: Fix an assertion failure in imp.create_dynamic(), when spec.name ↵Oren Milman2017-09-191-0/+5
| | | | is not a string. (#3257)
* bpo-31492: Fix assertion failures in case of a module with a bad __name__ ↵Oren Milman2017-09-191-0/+4
| | | | attribute. (#3620)
* Trivial cleanups following bpo-31370 (#3649)Antoine Pitrou2017-09-182-168/+159
| | | | | | * Trivial cleanups following bpo-31370 * Also cleanup the "importlib._bootstrap_external" module
* bpo-28411: Support other mappings in PyInterpreterState.modules. (#3593)Eric Snow2017-09-155-63/+128
| | | | | The concrete PyDict_* API is used to interact with PyInterpreterState.modules in a number of places. This isn't compatible with all dict subclasses, nor with other Mapping implementations. This patch switches the concrete API usage to the corresponding abstract API calls. We also add a PyImport_GetModule() function (and some other helpers) to reduce a bunch of code duplication.
* bpo-31338 (#3374)Barry Warsaw2017-09-158-27/+15
| | | | | | | * Add Py_UNREACHABLE() as an alias to abort(). * Use Py_UNREACHABLE() instead of assert(0) * Convert more unreachable code to use Py_UNREACHABLE() * Document Py_UNREACHABLE() and a few other macros.
* bpo-28411: Isolate PyInterpreterState.modules (#3575)Eric Snow2017-09-145-47/+84
| | | | | A bunch of code currently uses PyInterpreterState.modules directly instead of PyImport_GetModuleDict(). This complicates efforts to make changes relative to sys.modules. This patch switches to using PyImport_GetModuleDict() uniformly. Also, a number of related uses of sys.modules are updated for uniformity for the same reason. Note that this code was already reviewed and merged as part of #1638. I reverted that and am now splitting it up into more focused parts.
* bpo-30860: Fix a refleak. (#3567)Eric Snow2017-09-144-27/+31
| | | | | Resolves bpo-31420. (This was accidentally reverted when in #3565.)
* bpo-31404: Revert "remove modules from Py_InterpreterState (#1638)" (#3565)Eric Snow2017-09-149-238/+111
| | | PR #1638, for bpo-28411, causes problems in some (very) edge cases. Until that gets sorted out, we're reverting the merge. PR #3506, a fix on top of #1638, is also getting reverted.
* bpo-31418: Fix an assertion failure in PyErr_WriteUnraisable() in case of an ↵Oren Milman2017-09-131-1/+1
| | | | exception with a bad __module__ attribute. (#3539)
* bpo-30860: Fix a refleak. (#3506)Eric Snow2017-09-124-27/+31
| | | | | | | | | | | | | | * Drop warnoptions from PyInterpreterState. * Drop xoptions from PyInterpreterState. * Don't set warnoptions and _xoptions again. * Decref after adding to sys.__dict__. * Drop an unused macro. * Check sys.xoptions *before* we delete it.
* bpo-31416: Fix assertion failures in case of a bad warnings.filters or ↵Oren Milman2017-09-111-3/+16
| | | | | warnings.defaultaction. (#3496) Patch by Oren Milman.
* bpo-31373: remove overly strict float range checks (#3486)Benjamin Peterson2017-09-111-4/+0
| | | | | This undoes a853a8ba7850381d49b284295dd6f0dc491dbe44 except for the pytime.c parts. We want to continue to allow IEEE 754 doubles larger than FLT_MAX to be rounded into finite floats. Tests were added to very this behavior.