File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -196,11 +196,16 @@ def list_fonts(directory, extensions):
196
196
recursively under the directory.
197
197
"""
198
198
extensions = ["." + ext for ext in extensions ]
199
- return [os .path .join (dirpath , filename )
200
- # os.walk ignores access errors, unlike Path.glob.
201
- for dirpath , _ , filenames in os .walk (directory )
202
- for filename in filenames
203
- if Path (filename ).suffix .lower () in extensions ]
199
+ if sys .platform == 'win32' and directory == win32FontDirectory ():
200
+ return [os .path .join (directory , filename )
201
+ for filename in os .listdir (directory )
202
+ if os .path .isfile (filename )]
203
+ else :
204
+ return [os .path .join (dirpath , filename )
205
+ # os.walk ignores access errors, unlike Path.glob.
206
+ for dirpath , _ , filenames in os .walk (directory )
207
+ for filename in filenames
208
+ if Path (filename ).suffix .lower () in extensions ]
204
209
205
210
206
211
def win32FontDirectory ():
You can’t perform that action at this time.
0 commit comments