3 # os_ranks and mapping are mappings from names to how good they are.
5 # Higher numbers are worse but usable.
9 # 'Linux' : 3, # Linux (lots of systems support emulation)
11 _uname
[0] : 1, # Current OS
14 def _get_machine_ranks():
15 # Binaries compiled for _this_machine are best...
16 this_machine
= _uname
[-1]
17 machine_ranks
= {this_machine
: 0}
19 # If this_machine appears in the first column of this table, all
20 # following machine types on the line will also run on this one
21 # (earlier ones preferred):
24 'i586': ['i486', 'i386'],
25 'i686': ['i586', 'i486', 'i386'],
28 for supported
in _machine_matrix
.get(this_machine
, []):
29 machine_ranks
[supported
] = len(machine_ranks
)
31 # At the lowest priority, try a machine-independant implementation
32 machine_ranks
[None] = len(machine_ranks
)
35 machine_ranks
= _get_machine_ranks()