Skip to content

Commit e427df2

Browse files
adds code to require a envvar to be able to use billiard
1 parent 73f956d commit e427df2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

memory_profiler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222

2323
# TODO: provide alternative when multiprocessing is not available
2424
try:
25-
from billiard import Process, Pipe
25+
if "MEMPROF_PREFERS_BILLIARD" in os.environ and \
26+
os.environ["MEMPROF_PREFERS_BILLIARD"] in ["True", "true", "TRUE", "1"]:
27+
from billiard import Process, Pipe
2628
except ImportError:
2729
try:
2830
from multiprocessing import Process, Pipe

0 commit comments

Comments
 (0)