MCPcopy Index your code
hub / github.com/python/cpython / _ifconfig_getnode

Function _ifconfig_getnode

Lib/uuid.py:575–583  ·  view source on GitHub ↗

Get the hardware address on Unix by running ifconfig.

()

Source from the content-addressed store, hash-verified

573# The following functions call external programs to 'get' a macaddr value to
574# be used as basis for an uuid
575def _ifconfig_getnode():
576 """Get the hardware address on Unix by running ifconfig."""
577 # This works on Linux ('' or '-a'), Tru64 ('-av'), but not all Unixes.
578 keywords = (b'hwaddr', b'ether', b'address:', b'lladdr')
579 for args in ('', '-a', '-av'):
580 mac = _find_mac_near_keyword('ifconfig', args, keywords, lambda i: i+1)
581 if mac:
582 return mac
583 return None
584
585def _ip_getnode():
586 """Get the hardware address on Unix by running ip."""

Callers

nothing calls this directly

Calls 1

_find_mac_near_keywordFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…