File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11# Script Name : osinfo.py
22# Author : Craig Richards
33# Created : 5th April 2012
4- # Last Modified : 22nd February 2016
4+ # Last Modified : April 02 2016
55# Version : 1.0
66
77# Modifications : Changed the list to a dictionary. Although the order is lost, the info is with its label.
1212
1313profile = {
1414'Architecture: ' : platform .architecture (),
15- 'Linux Distribution: ' : platform .linux_distribution (),
15+ # 'Linux Distribution: ': platform.linux_distribution(),
1616'mac_ver: ' : platform .mac_ver (),
1717'machine: ' : platform .machine (),
1818'node: ' : platform .node (),
2727'version: ' : platform .version (),
2828}
2929
30+ if hasattr (platform , 'linux_distribution' ):
31+ #to avoid AttributeError exception in some old versions of the module
32+ profile ['linux_distribution' ] = platform .linux_distribution ()
33+ #FIXME: do this for all properties but in a loop
34+
3035for key in profile :
3136 print (key + str (profile [key ]))
You can’t perform that action at this time.
0 commit comments