]> granicus.if.org Git - python/commitdiff
Issue #26673: Protect IDLE from Linux fonts with reported default size 0.
authorTerry Jan Reedy <tjreedy@udel.edu>
Sun, 22 May 2016 18:35:24 +0000 (14:35 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Sun, 22 May 2016 18:35:24 +0000 (14:35 -0400)
Such fonts on Linux prevented the configuration dialog from opening.

Lib/idlelib/configHandler.py

index 531efb4b3e7bb4047bc66f4ec2c22b39d4539fa1..8ac1f6097a84957d48c8e33da700abe7c53b6bd1 100644 (file)
@@ -720,7 +720,7 @@ class IdleConf:
                 actualFont = Font.actual(f)
                 family = actualFont['family']
                 size = actualFont['size']
-                if size < 0:
+                if size <= 0:
                     size = 10  # if font in pixels, ignore actual size
                 bold = actualFont['weight']=='bold'
         return (family, size, 'bold' if bold else 'normal')