Skip to content

Commit

Permalink
Merge branch 'master' into nicstats-250
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Feb 15, 2015
2 parents 3042e9d + a09702e commit f18f2c4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions psutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,9 @@ def guess_it(fallback):
# Attempt to guess only in case of an absolute path.
# It is not safe otherwise as the process might have
# changed cwd.
if (os.path.isabs(exe)
and os.path.isfile(exe)
and os.access(exe, os.X_OK)):
if (os.path.isabs(exe) and
os.path.isfile(exe) and
os.access(exe, os.X_OK)):
return exe
if isinstance(fallback, AccessDenied):
raise fallback
Expand Down
6 changes: 3 additions & 3 deletions psutil/_pslinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ def virtual_memory():
active = int(line.split()[1]) * 1024
elif line.startswith(b"Inactive:"):
inactive = int(line.split()[1]) * 1024
if (cached is not None
and active is not None
and inactive is not None):
if (cached is not None and
active is not None and
inactive is not None):
break
else:
# we might get here when dealing with exotic Linux flavors, see:
Expand Down
8 changes: 4 additions & 4 deletions test/_posix.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ def call(p, attr):
if LINUX and get_kernel_version() < (2, 6, 36):
ignored_names.append('rlimit')
for name in dir(psutil.Process):
if (name.startswith('_')
or name.startswith('set_')
or name.startswith('get') # deprecated APIs
or name in ignored_names):
if (name.startswith('_') or
name.startswith('set_') or
name.startswith('get') or # deprecated APIs
name in ignored_names):
continue
else:
try:
Expand Down
8 changes: 4 additions & 4 deletions test/test_psutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -2098,10 +2098,10 @@ def test_halfway_terminated_process(self):
if LINUX and not RLIMIT_SUPPORT:
excluded_names.append('rlimit')
for name in dir(p):
if (name.startswith('_')
or name.startswith('get') # deprecated APIs
or name.startswith('set') # deprecated APIs
or name in excluded_names):
if (name.startswith('_') or
name.startswith('get') or # deprecated APIs
name.startswith('set') or # deprecated APIs
name in excluded_names):
continue
try:
meth = getattr(p, name)
Expand Down

0 comments on commit f18f2c4

Please sign in to comment.