This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients terry.reedy
Date 2016-06-06.02:57:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1465181854.1.0.00138868755932.issue27239@psf.upfronthosting.co.za>
In-reply-to
Content
Lib/idlelib/macosx.py:8 initializes _tk_type to None.  It next defines private function _initializeTkVariantTests, which in called in setupApp and which initializes _tk_type.  Then follow 4 isXyzTk functins, which "assert _tk_type is not None".  This is fine for IDLE because IDLE call setupApp on startup.

This is not fine for testing.  In general, tests do not and should not call setupApp. If a test happens to exercise one of the 11 (for now) isXyzTk calls occurring outside of macosx, the assert is triggered.  The test writer must then discover to import and call the supposedly private _initializeTkVariantTests.

I would prefer instead that maxosx be more self-contained, and initialize _tk_type as needed.  _initializeTkVariantTests needs a Tk instance for this line.
        ws = root.tk.call('tk', 'windowingsystem')
I would like to wrap that with root = tkinter.Tk() and root.destroy.  If that cannot be done on import, then instead of deleting the asserts, replace them with conditional calls to the initialization function.
History
Date User Action Args
2016-06-06 02:57:34terry.reedysetrecipients: + terry.reedy
2016-06-06 02:57:34terry.reedysetmessageid: <1465181854.1.0.00138868755932.issue27239@psf.upfronthosting.co.za>
2016-06-06 02:57:33terry.reedylinkissue27239 messages
2016-06-06 02:57:33terry.reedycreate