Skip to content

Commit 62f1f63

Browse files
committed
change the test, thanks input from armin we now force binary mode for python -m gzip with the -u parameter
1 parent 6f933fc commit 62f1f63

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

vmprof/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def _gzip_start(fileno):
6363
if which("gzip"):
6464
gzip_cmd = ["gzip", "-", "-4"]
6565
else:
66-
gzip_cmd = ["python", "-m", "gzip"]
66+
gzip_cmd = ["python", "-u", "-m", "gzip"]
6767
global _gzip_proc
6868
_gzip_proc = subprocess.Popen(gzip_cmd, stdin=subprocess.PIPE,
6969
stdout=fileno, bufsize=-1,
@@ -74,5 +74,7 @@ def _gzip_finish():
7474
global _gzip_proc
7575
if _gzip_proc is not None:
7676
_gzip_proc.stdin.close()
77-
_gzip_proc.wait()
77+
returncode = _gzip_proc.wait()
78+
assert returncode == 0, \
79+
"return code was non zero: %d" % returncode
7880
_gzip_proc = None

vmprof/test/test_run.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def function_bar():
4747

4848
def test_win32_issue():
4949
tmpfile = tempfile.NamedTemporaryFile(delete=False)
50+
print("target file", tmpfile.name, tmpfile.fileno())
5051
vmprof.enable(tmpfile.fileno())
5152
function_foo()
5253
vmprof.disable()

0 commit comments

Comments
 (0)