bpo-33656: Move pyshell ctypes import inside try block. (GH-9858) · python/cpython@77e0abe

Original file line numberDiff line numberDiff line change

@@ -12,11 +12,11 @@

1212

# Valid arguments for the ...Awareness call below are defined in the following.

1313

# https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx

1414

if sys.platform == 'win32':

15-

import ctypes

16-

PROCESS_SYSTEM_DPI_AWARE = 1

1715

try:

16+

import ctypes

17+

PROCESS_SYSTEM_DPI_AWARE = 1

1818

ctypes.OleDLL('shcore').SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE)

19-

except (AttributeError, OSError):

19+

except (ImportError, AttributeError, OSError):

2020

pass

2121
2222

import tkinter.messagebox as tkMessageBox