File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,26 @@ def collect_platform(info_add):
164164 if libc_ver :
165165 info_add ('platform.libc_ver' , libc_ver )
166166
167+ try :
168+ os_release = platform .freedesktop_os_release ()
169+ except OSError :
170+ pass
171+ else :
172+ for key in (
173+ 'ID' ,
174+ 'NAME' ,
175+ 'PRETTY_NAME'
176+ 'VARIANT' ,
177+ 'VARIANT_ID' ,
178+ 'VERSION' ,
179+ 'VERSION_CODENAME' ,
180+ 'VERSION_ID' ,
181+ ):
182+ if key not in os_release :
183+ continue
184+ info_add (f'platform.freedesktop_os_release[{ key } ]' ,
185+ os_release [key ])
186+
167187
168188def collect_locale (info_add ):
169189 import locale
@@ -920,7 +940,6 @@ def dump_info(info, file=None):
920940 for key , value in infos :
921941 value = value .replace ("\n " , " " )
922942 print ("%s: %s" % (key , value ))
923- print ()
924943
925944
926945def main ():
@@ -929,6 +948,7 @@ def main():
929948 dump_info (info )
930949
931950 if error :
951+ print ()
932952 print ("Collection failed: exit with error" , file = sys .stderr )
933953 sys .exit (1 )
934954
You can’t perform that action at this time.
0 commit comments