bpo-45447: Add syntax highlighting for .pyi files in IDLE (GH-28950)

Also add .pyi to the python extensions in the "File-open" and "File-save" dialogues.
Add util.py to contain objects that are used in multiple idlelib modules
and have no dependencies on any of them.

Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 50cf4991c4)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Terry Jan Reedy 2022-02-12 19:52:37 -05:00 committed by GitHub
parent b7a65c939c
commit 9fabcfbe68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 77 additions and 3 deletions

View file

@ -0,0 +1,14 @@
"""Test util, coverage 100%"""
import unittest
from idlelib import util
class UtilTest(unittest.TestCase):
def test_extensions(self):
for extension in {'.pyi', '.py', '.pyw'}:
self.assertIn(extension, util.py_extensions)
if __name__ == '__main__':
unittest.main(verbosity=2)