Terry J. Reedy added the comment:

(Brett, the question is about import.)

The problem is the mode call in clock.py, which I will move today as part of 
21882.

I am sorely puzzled that the patch in #21823 could have changed the effect of 
mode(). There are only two changes, only one of which could be relevant.

1.
 from turtle import *
+from turtle import Terminator  # not in __all__
 mode()

My understanding is that the newly added second import should just add a 
reference to Terminator in the existing module. It is a standard Exception 
subclass: from turtle.py, "class Terminator(Exception): pass".  I could and 
will add 'Terminator' to __all__ instead, but it seems to me that the added 
statement *should* be innocuous.

What am I missing? Does __all__ change the import machinery in the calls to 
frozen importlib.bootstrap or do these call always happen behind the scene with 
any import?  From the most recent first traceback:
...
  File 
"/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/turtledemo/clock.py",
 line 17 in <module>
  File "<frozen importlib._bootstrap>", line 321 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1420 in exec_module
  File "<frozen importlib._bootstrap>", line 1149 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 2175 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 2186 in _find_and_load
  File "<string>", line 1 in <module>
  File 
"/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test___all__.py",
 line 23 in check_all
...

2. Added a try:except: within a function, not called on import, to catch 
previously uncaught Terminator exception.

----------
nosy: +brett.cannon

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21884>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to