@@ -54,11 +54,7 @@ def onerror(function, path, excinfo):
5454def getFileProperties (fname ):
5555 """Read all properties of the given file return them as a dictionary."""
5656 import win32api
57- prop_names = (
58- 'Comments' , 'InternalName' , 'ProductName' , 'CompanyName' , 'LegalCopyright' ,
59- 'ProductVersion' , 'FileDescription' , 'LegalTrademarks' , 'PrivateBuild' ,
60- 'FileVersion' , 'OriginalFilename' , 'SpecialBuild'
61- )
57+ prop_names = ('ProductName' , 'ProductVersion' , 'FileDescription' , 'FileVersion' )
6258 props = {'FixedFileInfo' : None , 'StringFileInfo' : None , 'FileVersion' : None }
6359
6460 try :
@@ -83,16 +79,11 @@ def getFileProperties(fname):
8379def get_special_folder_path (path_name ):
8480 """Return special folder path."""
8581 from win32com .shell import shell , shellcon
86- for maybe in """
87- CSIDL_COMMON_STARTMENU CSIDL_STARTMENU CSIDL_COMMON_APPDATA
88- CSIDL_LOCAL_APPDATA CSIDL_APPDATA CSIDL_COMMON_DESKTOPDIRECTORY
89- CSIDL_DESKTOPDIRECTORY CSIDL_COMMON_STARTUP CSIDL_STARTUP
90- CSIDL_COMMON_PROGRAMS CSIDL_PROGRAMS CSIDL_PROGRAM_FILES_COMMON
91- CSIDL_PROGRAM_FILES CSIDL_FONTS""" .split ():
92- if maybe == path_name :
93- csidl = getattr (shellcon , maybe )
94- return shell .SHGetSpecialFolderPath (0 , csidl , False )
95- raise ValueError (f"{ path_name } is an unknown path ID" )
82+ try :
83+ csidl = getattr (shellcon , path_name )
84+ return shell .SHGetSpecialFolderPath (0 , csidl , False )
85+ except OSError :
86+ print (f"{ path_name } is an unknown path ID" )
9687
9788def get_winpython_start_menu_folder (current = True ):
9889 """Return WinPython Start menu shortcuts folder."""
@@ -337,7 +328,7 @@ def buildflit_wininst(root, python_exe=None, copy_to=None, verbose=False):
337328 break
338329 else :
339330 raise RuntimeError (f"Build failed: not a pure Python package? { distdir } " )
340-
331+
341332 src_fname = distdir / distname
342333 if copy_to :
343334 dst_fname = Path (copy_to ) / distname
0 commit comments