Switch comments

This commit is contained in:
ZyX 2014-03-13 19:41:59 +04:00
parent ecf26dfbc6
commit 678d47c61e
1 changed files with 2 additions and 2 deletions

View File

@ -517,11 +517,11 @@ try:
if data: if data:
yield interface, data.bytes_recv, data.bytes_sent yield interface, data.bytes_recv, data.bytes_sent
# Pre psutil-2.0.0: psutil.Process.username has type property # psutil-2.0.0: psutil.Process.username is unbound method
if callable(psutil.Process.username): if callable(psutil.Process.username):
def _get_user(segment_info): def _get_user(segment_info):
return psutil.Process(os.getpid()).username() return psutil.Process(os.getpid()).username()
# psutil-2.0.0: psutil.Process.username is unbound method # pre psutil-2.0.0: psutil.Process.username has type property
else: else:
def _get_user(segment_info): def _get_user(segment_info):
return psutil.Process(os.getpid()).username return psutil.Process(os.getpid()).username