Skip to content

Commit 0449dca

Browse files
authored
Merge pull request #2858 from pygame-community/ankith26-fix-pylint-error
Fix pylint undefined usage error in sysfont
2 parents a21ccf2 + b142ada commit 0449dca

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src_py/sysfont.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
from pygame.font import Font
3030
from pygame import __file__ as pygame_main_file
3131

32-
if sys.platform != "emscripten":
33-
if os.name == "nt":
34-
import winreg as _winreg
35-
import subprocess
36-
3732

3833
OpenType_extensions = frozenset((".ttf", ".ttc", ".otf"))
3934
Sysfonts = {}
@@ -57,6 +52,7 @@ def _addfont(name, bold, italic, font, fontdict):
5752

5853
def initsysfonts_win32():
5954
"""initialize fonts dictionary on Windows"""
55+
import winreg as _winreg
6056

6157
fontdir = join(os.environ.get("WINDIR", "C:\\Windows"), "Fonts")
6258
fonts = {}
@@ -212,6 +208,8 @@ def initsysfonts_unix(path="fc-list"):
212208
if sys.platform == "emscripten":
213209
return fonts
214210

211+
import subprocess
212+
215213
try:
216214
proc = subprocess.run(
217215
[path, ":", "file", "family", "style"],

0 commit comments

Comments
 (0)