Skip to content

bpo-40170: Convert PyIter_Check macro to a function - #24548

Merged
vstinner merged 6 commits into
python:masterfrom
erlend-aasland:bpo-40170/PyIter_Check
Feb 16, 2021
Merged

bpo-40170: Convert PyIter_Check macro to a function#24548
vstinner merged 6 commits into
python:masterfrom
erlend-aasland:bpo-40170/PyIter_Check

Conversation

@erlend-aasland

@erlend-aaslanderlend-aasland commented Feb 16, 2021

Copy link
Copy Markdown
Contributor

The macro accessed the PyTypeObject.tp_iternext member directly.
"Swap" macro variant with the function in order to hide implementation details.
(A function already existed, but it was not exposed.)

https://bugs.python.org/issue40170

@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

@vstinner Would you mind reviewing this?

@vstinnervstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For macOS which doesn't use LTO compiler optimization, we added private static inline functions of some "Check" functions. But I don't think that it's worth it here (I don't think that the function is commonly called in "hot code").

Comment threadObjects/abstract.c Outdated
Comment threadInclude/cpython/abstract.h Outdated
Comment threadDoc/c-api/iter.rst
Comment threadMisc/NEWS.d/next/Core and Builtins/2021-02-15-15-06-43.bpo-40170.ZYeSii.rst Outdated
Erlend Egeberg Aaslandand others added 4 commits February 16, 2021 13:10
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

CI is done; PTAL, @vstinner.

@vstinner
vstinner merged commit cc54001 into python:masterFeb 16, 2021
@vstinner

Copy link
Copy Markdown
Member

Merged, thanks.

@erlend-aasland
erlend-aasland deleted the bpo-40170/PyIter_Check branch February 16, 2021 15:14
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot PPC64LE RHEL8 LTO + PGO 3.x has failed when building commit cc54001.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/458/builds/1109) and take a look at the build logs.
  4. Check if the failure is related to this commit (cc54001) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/458/builds/1109

Summary of the results of the build (if available):

== Tests result: ENV CHANGED ==

411 tests OK.

10 slowest tests:

  • test_concurrent_futures: 2 min 44 sec
  • test_multiprocessing_spawn: 1 min 49 sec
  • test_tokenize: 1 min 12 sec
  • test_asyncio: 1 min 9 sec
  • test_multiprocessing_forkserver: 1 min 2 sec
  • test_multiprocessing_fork: 1 min 1 sec
  • test_unparse: 50.5 sec
  • test_lib2to3: 48.7 sec
  • test_signal: 47.5 sec
  • test_io: 38.7 sec

1 test altered the execution environment:
test_asyncio

14 tests skipped:
test_devpoll test_gdb test_ioctl test_kqueue test_msilib
test_ossaudiodev test_startfile test_tix test_tk test_ttk_guionly
test_winconsoleio test_winreg test_winsound test_zipfile64

Total duration: 4 min 31 sec

Click to see traceback logs
Traceback (most recent call last):
File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/asyncio/sslproto.py", line 321, in __del__self.close()
File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/asyncio/sslproto.py", line 316, in closeself._ssl_protocol._start_shutdown()
File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/asyncio/sslproto.py", line 590, in _start_shutdownself._abort()
File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/asyncio/sslproto.py", line 731, in _abortself._transport.abort()
File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/asyncio/selector_events.py", line 680, in abortself._force_close(None)
File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/asyncio/selector_events.py", line 731, in _force_closeself._loop.call_soon(self._call_connection_lost, exc)
File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/asyncio/base_events.py", line 745, in call_soonself._check_closed()
File "/home/buildbot/buildarea/3.x.cstratak-RHEL8-ppc64le.lto-pgo/build/Lib/asyncio/base_events.py", line 510, in _check_closedraiseRuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

erlend-aasland pushed a commit to erlend-aasland/cpython that referenced this pull request Feb 17, 2021
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@erlend-aasland@vstinner@bedevere-bot@the-knights-who-say-ni