Skip to content

Commit 555071b

Browse files
author
David Alger
authored
Fixes invalid psutil usage on darwin
Running this on OS X resulted in the following error: ``` Traceback (most recent call last): File "/usr/local/bin/mwscan", line 11, in <module> sys.exit(main()) File "/usr/local/lib/python2.7/site-packages/mwscan/mwscan.py", line 207, in main mylife.ionice(psutil.IOPRIO_CLASS_IDLE) AttributeError: 'Process' object has no attribute 'ionice' ``` The documentation for ionice states that it's only available in "Linux and Windows > Vista". This check allows `mywscan` to successfully run on OS X.
1 parent c8acc9a commit 555071b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mwscan/mwscan.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def main():
202202
args = parse_args()
203203

204204
# don't swamp the machine
205-
if psutil:
205+
if psutil and sys.platform != "darwin":
206206
mylife = psutil.Process()
207207
mylife.ionice(psutil.IOPRIO_CLASS_IDLE)
208208

0 commit comments

Comments
 (0)