diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2018-10-14 00:00:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-14 00:00:31 (GMT) |
commit | d274afb5e579a5d9d990f68f9af856cf4c918779 (patch) | |
tree | 4a6ee32c3bb0e54a293319ee44e7d5ea8ad69ced | |
parent | 97cf0828727ac2a269c89c5aa09570a69a22c83c (diff) | |
download | cpython-d274afb5e579a5d9d990f68f9af856cf4c918779.zip cpython-d274afb5e579a5d9d990f68f9af856cf4c918779.tar.gz cpython-d274afb5e579a5d9d990f68f9af856cf4c918779.tar.bz2 |
bpo-33656: Move pyshell ctypes import inside try block. (GH-9858)
A Windows build with _tkinter, tkinter, and idlelib
but without ctypes is unlikely but apparently possible.
-rwxr-xr-x | Lib/idlelib/pyshell.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py index 5458c59..47eef43 100755 --- a/Lib/idlelib/pyshell.py +++ b/Lib/idlelib/pyshell.py @@ -12,11 +12,11 @@ except ImportError: # Valid arguments for the ...Awareness call below are defined in the following. # https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx if sys.platform == 'win32': - import ctypes - PROCESS_SYSTEM_DPI_AWARE = 1 try: + import ctypes + PROCESS_SYSTEM_DPI_AWARE = 1 ctypes.OleDLL('shcore').SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE) - except (AttributeError, OSError): + except (ImportError, AttributeError, OSError): pass import tkinter.messagebox as tkMessageBox |