]> granicus.if.org Git - python/commitdiff
bpo-33656: Add enum name for argument of Windows call. (GH-7642)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 11 Jun 2018 20:08:24 +0000 (13:08 -0700)
committerGitHub <noreply@github.com>
Mon, 11 Jun 2018 20:08:24 +0000 (13:08 -0700)
Change suggested by Eryk Sun in a comment on PR 7137 after it was merged.
(cherry picked from commit fd88f319a4f40682b989b63f0b6378d69465fda4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Lib/idlelib/pyshell.py

index f39f15696e7e0170cee453301dc3013a68c9f95e..ddfb56acdbc44fa01e84a611c5557fcfa8e59d88 100755 (executable)
@@ -9,10 +9,13 @@ except ImportError:
           "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