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
@@ -913,7 +933,6 @@ def dump_info(info, file=None):
913
933
for key , value in infos :
914
934
value = value .replace ("\n " , " " )
915
935
print ("%s: %s" % (key , value ))
916
- print ()
917
936
918
937
919
938
def main ():
@@ -922,6 +941,7 @@ def main():
922
941
dump_info (info )
923
942
924
943
if error :
944
+ print ()
925
945
print ("Collection failed: exit with error" , file = sys .stderr )
926
946
sys .exit (1 )
927
947
You can’t perform that action at this time.
0 commit comments