Skip to content

Commit f4f6ec1

Browse files
committed
PyPy 5.9 supports real_time=True: make it sure that we can actually pass it
1 parent 223696d commit f4f6ec1

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

vmprof/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,17 @@ def enable(fileno, period=DEFAULT_PERIOD, memory=False, lines=False, native=None
6666
print("Memory profiling is currently unsupported for PyPy. Running without memory statistics.")
6767
if warn and lines:
6868
print('Line profiling is currently unsupported for PyPy. Running without lines statistics.\n')
69-
if real_time:
70-
raise ValueError('real_time=True is currently not supported on PyPy.')
7169
native = _is_native_enabled(native)
7270
#
7371
if MAJOR >= 5 and MINOR >= 9 and PATCH >= 0:
7472
_vmprof.enable(fileno, period, memory, lines, native, real_time)
75-
elif MAJOR >= 5 and MINOR >= 8 and PATCH >= 0:
73+
return
74+
if real_time:
75+
raise ValueError('real_time=True requires PyPy >= 5.9')
76+
if MAJOR >= 5 and MINOR >= 8 and PATCH >= 0:
7677
_vmprof.enable(fileno, period, memory, lines, native)
77-
else:
78-
_vmprof.enable(fileno, period)
78+
return
79+
_vmprof.enable(fileno, period)
7980
else:
8081
# CPYTHON
8182
def enable(fileno, period=DEFAULT_PERIOD, memory=False, lines=False, native=None, real_time=False):

0 commit comments

Comments
 (0)