Commits · python/cpython

Commits on Oct 12, 2021

  1. bpo-45439: Move _PyObject_CallNoArgs() to pycore_call.h (GH-28895)

    * Move _PyObject_CallNoArgs() to pycore_call.h (internal C API).
    * _ssl, _sqlite and _testcapi extensions now call the public
      PyObject_CallNoArgs() function, rather than _PyObject_CallNoArgs().
    * _lsprof extension is now built with Py_BUILD_CORE_MODULE macro
      defined to get access to internal _PyObject_CallNoArgs().

Commits on Oct 11, 2021

  1. bpo-45412: Move _Py_SET_53BIT_PRECISION_START to pycore_pymath.h (GH-…

    …28882)
    
    Move the following macros , to pycore_pymath.h (internal C API):
    
    * _Py_SET_53BIT_PRECISION_HEADER
    * _Py_SET_53BIT_PRECISION_START
    * _Py_SET_53BIT_PRECISION_END
    
    PEP 7: add braces to if and "do { ... } while (0)" in these macros.
    
    Move also _Py_get_387controlword() and _Py_set_387controlword()
    definitions to pycore_pymath.h. These functions are no longer
    exported.
    
    pystrtod.c now includes pycore_pymath.h.
  2. bpo-45412: Remove Py_SET_ERRNO_ON_MATH_ERROR() macro (GH-28820)

    Remove the following math macros using the errno variable:
    
    * Py_ADJUST_ERANGE1()
    * Py_ADJUST_ERANGE2()
    * Py_OVERFLOWED()
    * Py_SET_ERANGE_IF_OVERFLOW()
    * Py_SET_ERRNO_ON_MATH_ERROR()
    
    Create pycore_pymath.h internal header file.
    
    Rename Py_ADJUST_ERANGE1() and Py_ADJUST_ERANGE2() to
    _Py_ADJUST_ERANGE1() and _Py_ADJUST_ERANGE2(), and convert these
    macros to static inline functions.
    
    Move the following macros to pycore_pymath.h:
    
    * _Py_IntegralTypeSigned()
    * _Py_IntegralTypeMax()
    * _Py_IntegralTypeMin()
    * _Py_InIntegralTypeRange()

Commits on Oct 10, 2021

Commits on Oct 9, 2021

  1. bpo-45353: Remind sys.modules users to copy when iterating. (GH-28842)

    This is true of all dictionaries in Python, but this one tends to
    catch people off guard as they don't realize when sys.modules might
    change out from underneath them as a hidden side effect of their
    code.  Copying it first avoids the RuntimeError.  An example when
    this happens in single threaded code are codecs being loaded which
    are an implicit time of use import that most need not think about.