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):
164
164
if libc_ver :
165
165
info_add ('platform.libc_ver' , libc_ver )
166
166
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
+
167
187
168
188
def collect_locale (info_add ):
169
189
import locale
@@ -921,7 +941,6 @@ def dump_info(info, file=None):
921
941
for key , value in infos :
922
942
value = value .replace ("\n " , " " )
923
943
print ("%s: %s" % (key , value ))
924
- print ()
925
944
926
945
927
946
def main ():
@@ -930,6 +949,7 @@ def main():
930
949
dump_info (info )
931
950
932
951
if error :
952
+ print ()
933
953
print ("Collection failed: exit with error" , file = sys .stderr )
934
954
sys .exit (1 )
935
955
You can’t perform that action at this time.
0 commit comments