[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

python/cpython

aeros

The Wayback Machine - http://web.archive.org/web/20200131225254/https://github.com/python/cpython/commits/master

Permalink

Commits on Jan 31, 2020

Commits on Jan 30, 2020

  1. bpo-38631: Replace Py_FatalError() with _PyObject_ASSERT_FAILED_MSG() (…

    …GH-18258)
    
    Replace Py_FatalError() with _PyObject_ASSERT_FAILED_MSG() in
    object.c and typeobject.c to also dump the involved Python object on
    a fatal error. It should ease debug when such fatal error occurs.
    
    If the double linked list is inconsistent, _Py_ForgetReference() no
    longer dumps previous and next objects in the fatal error, it now
    only dumps the current object. It ensures that the error message
    is displayed even if dumping the object does crash Python.
    
    Enhance _Py_ForgetReference() error messages;
    _PyObject_ASSERT_FAILED_MSG() logs the "_Py_ForgetReference" function
    name.

Commits on Jan 29, 2020

  1. Get mock coverage back to 100% (GH-18228)

    * use the `: pass` and `: yield` patterns for code that isn't expected to ever be executed.
    
    * The _Call items passed to _AnyComparer are only ever of length two, so assert instead of if/else
    
    * fix typo
    
    * Fix bug, where stop-without-start patching dict blows up with `TypeError: 'NoneType' object is not iterable`, highlighted by lack of coverage of an except branch.
    
    * The fix for bpo-37972 means _Call.count and _Call.index are no longer needed.
    
    * add coverage for calling next() on a mock_open with readline.return_value set.
    
    * __aiter__ is defined on the Mock so the one on _AsyncIterator is never called.
  2. bpo-39485: fix corner-case in method-detection of mock (GH-18252)

    Replace check for whether something is a method in the mock module. The
    previous version fails on PyPy, because there no method wrappers exist
    (everything looks like a regular Python-defined function). Thus the
    isinstance(getattr(result, '__get__', None), MethodWrapperTypes) check
    returns True for any descriptor, not just methods.
    
    This condition could also return erroneously True in CPython for
    C-defined descriptors.
    
    Instead to decide whether something is a method, just check directly
    whether it's a function defined on the class. This passes all tests on
    CPython and fixes the bug on PyPy.
  3. bpo-39153: Clarify C API *SetItem refcounting semantics (GH-18220)

    Some of the *SetItem methods in the C API steal a reference to the
    given value. This annotates the better behaved ones to assure the
    reader that these are not the ones with the inconsistent behaviour.
    
    * 📜🤖 Added by blurb_it.
    
    * make docs consistent with signature
    
    Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>

Commits on Jan 28, 2020