Ticket #57034: uuid-64bit.patch
File uuid-64bit.patch, 1.1 KB (added by rmottola (Riccardo), 6 years ago) |
---|
-
uuid.py
old new 522 522 523 523 _node = None 524 524 525 _NODE_GETTERS_WIN32 = [_windll_getnode, _netbios_getnode, _ipconfig_getnode]526 527 _NODE_GETTERS_UNIX = [_unixdll_getnode, _ifconfig_getnode, _arp_getnode,528 _lanscan_getnode, _netstat_getnode]529 530 531 525 def getnode(): 532 526 """Get the hardware address as a 48-bit positive integer. 533 527 … … 543 537 544 538 import sys 545 539 if sys.platform == 'win32': 546 getters = _NODE_GETTERS_WIN32540 getters = [_windll_getnode, _netbios_getnode, _ipconfig_getnode] 547 541 else: 548 getters = _NODE_GETTERS_UNIX 542 getters = [_unixdll_getnode, _ifconfig_getnode, _arp_getnode, 543 _lanscan_getnode, _netstat_getnode] 549 544 550 545 for getter in getters + [_random_getnode]: 551 546 try: 552 547 _node = getter() 553 548 except: 554 549 continue 555 if (_node is not None) and (0 <= _node < (1 << 48)):550 if _node is not None: 556 551 return _node 557 assert False, '_random_getnode() returned invalid value: {}'.format(_node)558 552 559 553 _last_timestamp = None 560 554