Skip to content

Commit

Permalink
forgot to close the handle
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Feb 28, 2015
1 parent 29defce commit f252bd0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions psutil/_psutil_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ psutil_proc_name(PyObject *self, PyObject *args) {
pentry.dwSize = sizeof(PROCESSENTRY32);
ok = Process32First(hSnapShot, &pentry);
if (! ok) {
CloseHandle(hSnapShot);
PyErr_SetFromWindowsErr(0);
return NULL;
}
Expand Down
4 changes: 2 additions & 2 deletions test/_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,10 @@ def compare_with_tolerance(ret1, ret2, tolerance):
compare_with_tolerance(ret[3], nt.io_wbytes, tolerance)
elif name == 'proc_memory_info':
try:
rawtuple = _psutil_windows.proc_memory_info_2(p.pid)
rawtupl = _psutil_windows.proc_memory_info_2(p.pid)
except psutil.NoSuchProcess:
continue
compare_with_tolerance(ret, rawtuple, tolerance)
compare_with_tolerance(ret, rawtupl, tolerance)
except AssertionError:
trace = traceback.format_exc()
msg = '%s\npid=%s, method=%r, ret_1=%r, ret_2=%r' % (
Expand Down

0 comments on commit f252bd0

Please sign in to comment.