Fix uuid failure on systems with 64-bit hardware addresses:
https://bugs.python.org/issue32502
Backported from:
https://github.com/python/cpython/commit/d69794f4df81de731cc66dc82136e28bee691e1e#diff-9d2d23bf4362c9ec2b6dd4b64b73756c
--- Lib/uuid.py.orig	2018-04-29 17:47:33.000000000 -0500
+++ Lib/uuid.py	2018-08-25 23:35:37.000000000 -0500
@@ -522,6 +522,12 @@
 
 _node = None
 
+_NODE_GETTERS_WIN32 = [_windll_getnode, _netbios_getnode, _ipconfig_getnode]
+
+_NODE_GETTERS_UNIX = [_unixdll_getnode, _ifconfig_getnode, _arp_getnode,
+                      _lanscan_getnode, _netstat_getnode]
+
+
 def getnode():
     """Get the hardware address as a 48-bit positive integer.
 
@@ -537,18 +543,18 @@
 
     import sys
     if sys.platform == 'win32':
-        getters = [_windll_getnode, _netbios_getnode, _ipconfig_getnode]
+        getters = _NODE_GETTERS_WIN32
     else:
-        getters = [_unixdll_getnode, _ifconfig_getnode, _arp_getnode,
-                   _lanscan_getnode, _netstat_getnode]
+        getters = _NODE_GETTERS_UNIX
 
     for getter in getters + [_random_getnode]:
         try:
             _node = getter()
         except:
             continue
-        if _node is not None:
+        if (_node is not None) and (0 <= _node < (1 << 48)):
             return _node
+    assert False, '_random_getnode() returned invalid value: {}'.format(_node)
 
 _last_timestamp = None
 
