[Python-checkins] bpo-33656: Add enum name for argument of Windows call. (GH-7642)

Terry Jan Reedy webhook-mailer at python.org
Mon Jun 11 15:45:30 EDT 2018


https://github.com/python/cpython/commit/fd88f319a4f40682b989b63f0b6378d69465fda4
commit: fd88f319a4f40682b989b63f0b6378d69465fda4
branch: master
author: Terry Jan Reedy <tjreedy at udel.edu>
committer: GitHub <noreply at github.com>
date: 2018-06-11T15:45:27-04:00
summary:

bpo-33656: Add enum name for argument of Windows call. (GH-7642)

Change suggested by Eryk Sun in a comment on PR 7137 after it was merged.

files:
M Lib/idlelib/pyshell.py

diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py
index f39f15696e7e..ddfb56acdbc4 100755
--- a/Lib/idlelib/pyshell.py
+++ b/Lib/idlelib/pyshell.py
@@ -9,10 +9,13 @@
           "Your Python may not be configured for Tk. **", file=sys.__stderr__)
     raise SystemExit(1)
 
+# 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:
-        ctypes.OleDLL('shcore').SetProcessDpiAwareness(1)
+        ctypes.OleDLL('shcore').SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE)
     except (AttributeError, OSError):
         pass
 



More information about the Python-checkins mailing list