Skip to content

Commit

Permalink
better check for net_if_addrs availability
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnon Yaari committed Aug 4, 2015
1 parent 4dde033 commit f513c21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions psutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import signal
import subprocess
import sys
import platform
import time
try:
import pwd
Expand Down Expand Up @@ -1746,8 +1745,7 @@ def net_connections(kind='inet'):
return _psplatform.net_connections(kind)


NO_IFADDRS = sys.platform.startswith("sunos") and platform.release() == "5.10"
if not NO_IFADDRS:
if hasattr(_psplatform, "net_if_addrs"):
def net_if_addrs():
"""Return the addresses associated to each NIC (network interface
card) installed on the system as a dictionary whose keys are the
Expand Down
2 changes: 1 addition & 1 deletion test/test_psutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2790,7 +2790,7 @@ def test__all__(self):
for name in dir_psutil:
if name in ('callable', 'error', 'namedtuple',
'long', 'test', 'NUM_CPUS', 'BOOT_TIME',
'TOTAL_PHYMEM', "NO_IFADDRS"):
'TOTAL_PHYMEM'):
continue
if not name.startswith('_'):
try:
Expand Down

0 comments on commit f513c21

Please sign in to comment.