Terry J. Reedy added the comment:

Remove the now unneeded call in htest to _init_tk_type.  It was tempting to 
leave the call for the 'efficiency' of the direct call with the available root, 
but there is a mental efficiency in removing it and making _init_tk_type 
completely an internal implementation detail of macosx.

Remove the unneeded call in macosx.setupApp.  This makes the _init_tk_type 
local to its section of the module.  It also allows a test to set _tk_type to 
simulate being on a particular type of Mac and call setupApp without having the 
setting overwritten by the real value. Test_macosx now calls setupApp with each 
_tk_type set to each possible non-None value.

The same objective could have been met by conditioning the call with 'if 
_tk_type is  None:', but removing the call means that _init_tk_type is no 
longer ever called with a root, so the parameter can be removed and the 
function simplified.  This section of macosx now takes care of initializing 
itself and the rest of IDLE can simply call the isTypeTk functions without 
worrying about initialization.

Have macosx call its test when run as main.

----------

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

Reply via email to