Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-131798: Remove guard for known type in TO_BOOL_STR#131816

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
brandtbucher merged 9 commits intopython:mainfromfluhus:amit
Mar 30, 2025

Conversation

fluhus
Copy link
Contributor

@fluhusfluhus commentedMar 28, 2025
edited by brandtbucher
Loading

Guard is unnecessary if we already know the value's type.

@brandtbucher

Copy link
Member

@brandtbucherbrandtbucher left a comment

Choose a reason for hiding this comment

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

Looks good, just some style nitpicks. Can you also add a NEWS entry?

@brandtbucher
Copy link
Member

Also, I'm changing the issue number toGH-131798, since that fits better.

@brandtbucherbrandtbucher changed the titlegh-130415: Remove guard for known type in TO_BOOL_STRGH-131798: Remove guard for known type in TO_BOOL_STRMar 28, 2025
@fluhus
Copy link
ContributorAuthor

Thanks,@brandtbucher!
I submitted the style changes (my auto-formatter is eager, sorry). Created a NEWS entry too.

@brandtbucher
Copy link
Member

Stats look good. Looks like we're removing 25% of ourstr checks!

@brandtbucherbrandtbucher merged commit685fd74 intopython:mainMar 30, 2025
62 of 64 checks passed
@bedevere-bot
Copy link

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

Hi! The buildbotARM64 MacOS M1 Refleaks NoGIL 3.x (tier-2) has failed when building commit685fd74.

What do you need to do:

  1. Don't panic.
  2. Checkthe 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/#/builders/1368/builds/2906) and take a look at the build logs.
  4. Check if the failure is related to this commit (685fd74) 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/#/builders/1368/builds/2906

Failed tests:

  • test_import
  • test.test_concurrent_futures.test_interpreter_pool

Failed subtests:

  • test_free_reference - test.test_concurrent_futures.test_interpreter_pool.InterpreterPoolExecutorTest.test_free_reference

Test leaking resources:

  • test_events: references
  • test_import: memory blocks
  • test_import: references

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

==

Click to see traceback logs
TracebackTests.test_nonexistent_module_nested) ... okTracebackTests.test_broken_parent_from) ... okTracebackTests.test_unencodable_filename) ... skipped 'need TESTFN_UNENCODABLE'Traceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/concurrent/futures/thread.py", line99, in_worker    ctx.initialize()~~~~~~~~~~~~~~^^  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/concurrent/futures/interpreter.py", line132, ininitializeself.interpid= _interpreters.create(reqrefs=True)~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^interpreters.InterpreterError:interpreter creation failedTimeout (0:45:00)!Thread 0x0000000173dcb000 (most recent call first):  File "/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/concurrent/futures/thread.py", line 116 in _worker  File "/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/threading.py", line 996 in run  File "/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/threading.py", line 1054 in _bootstrap_inner  File "/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/threading.py", line 1016 in _bootstrapTracebackTests.test_broken_submodule) ... okTracebackTests.test_broken_parent) ... okTracebackTests.test_exec_failure) ... okTracebackTests.test_exec_failure_nested) ... okTracebackTests.test_nonexistent_module) ... okTracebackTests.test_syntax_error) ... okTraceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/concurrent/futures/thread.py", line99, in_worker    ctx.initialize()~~~~~~~~~~~~~~^^  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/concurrent/futures/interpreter.py", line132, ininitializeself.interpid= _interpreters.create(reqrefs=True)~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^interpreters.InterpreterError:interpreter creation failedTracebackTests.test_broken_from) ... okTracebackTests.test_import_bug) ... okTraceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/threading.py", line1054, in_bootstrap_innerself.run()~~~~~~~~^^  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/threading.py", line996, inrunself._target(*self._args,**self._kwargs)~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/concurrent/futures/thread.py", line104, in_worker    executor._initializer_failed()~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/concurrent/futures/thread.py", line252, in_initializer_failed    work_item.future.set_exception(self.BROKEN(self._broken))~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/concurrent/futures/_base.py", line553, inset_exceptionraise InvalidStateError('{}:{!r}'.format(self._state,self))concurrent.futures._base.InvalidStateError:CANCELLED: <Future at 0x200008e3680 state=cancelled>ERRORTraceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/test/test_concurrent_futures/executor.py", line200, intest_free_referencefor objinself.executor.map(make_dummy_object,range(10)):~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/concurrent/futures/_base.py", line639, inresult_iteratoryield _result_or_cancel(fs.pop())~~~~~~~~~~~~~~~~~^^^^^^^^^^  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/concurrent/futures/_base.py", line311, in_result_or_cancelreturn fut.result(timeout)~~~~~~~~~~^^^^^^^^^  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/concurrent/futures/_base.py", line450, inresultreturnself.__get_result()~~~~~~~~~~~~~~~~~^^  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/concurrent/futures/_base.py", line395, in__get_resultraiseself._exceptionconcurrent.futures.interpreter.BrokenInterpreterPool:A thread initializer failed, the thread pool is not usable anymoreTraceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/concurrent/futures/thread.py", line99, in_worker    ctx.initialize()~~~~~~~~~~~~~~^^  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/concurrent/futures/interpreter.py", line132, ininitializeself.interpid= _interpreters.create(reqrefs=True)~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^interpreters.InterpreterError:interpreter creation failedWarning -- Uncaught thread exception: InvalidStateErrorException in thread ThreadPoolExecutor-109_4:RuntimeError:Failed to import encodings moduleTraceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/asyncio/selector_events.py", line873, in__del__    _warn(f"unclosed transport{self!r}",ResourceWarning,source=self)ResourceWarning:unclosed transport <_SelectorSocketTransport fd=7>Warning -- Unraisable exceptionException ignored while calling deallocator <function _SSLProtocolTransport.__del__ at 0x200020e55d0>:Traceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/asyncio/sslproto.py", line123, in__del__    _warnings.warn(ResourceWarning:unclosed transport <asyncio._SSLProtocolTransport object>Warning -- Unraisable exceptionException ignored while finalizing socket <socket.socket fd=7, family=2, type=1, proto=0, laddr=('127.0.0.1', 59335), raddr=('127.0.0.1', 59336)>:Traceback (most recent call last):  File"/Users/ec2-user/buildbot/buildarea/3.x.itamaro-macos-arm64-aws.macos-with-brew.refleak.nogil/build/Lib/test/support/__init__.py", line814, ingc_collect    gc.collect()ResourceWarning:unclosed <socket.socket fd=7, family=2, type=1, proto=0, laddr=('127.0.0.1', 59335), raddr=('127.0.0.1', 59336)>k

seehwan pushed a commit to seehwan/cpython that referenced this pull requestApr 16, 2025
@fluhusfluhus deleted the amit branchMay 5, 2025 21:10
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@brandtbucherbrandtbucherbrandtbucher approved these changes

@Fidget-SpinnerFidget-SpinnerAwaiting requested review from Fidget-SpinnerFidget-Spinner is a code owner

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@fluhus@brandtbucher@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp