We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b75bf76 commit e6a7363Copy full SHA for e6a7363
1 file changed
wolframclient/cli/commands/benchmark.py
@@ -1,6 +1,5 @@
1
from __future__ import absolute_import, print_function, unicode_literals
2
3
-import cProfile
4
import decimal
5
import os
6
import tempfile
@@ -12,6 +11,7 @@
12
11
from wolframclient.utils.debug import timed
13
from wolframclient.utils.encoding import force_text
14
from wolframclient.utils.functional import first
+from wolframclient.utils.importutils import safe_import_string_and_call
15
16
17
def repeat(el, n=1):
@@ -125,6 +125,8 @@ def report(self):
125
126
def handle(self, profile, **opts):
127
if profile:
128
- cProfile.runctx("report()", {"report": self.report}, {})
+ safe_import_string_and_call(
129
+ "cProfile.runctx", "report()", {"report": self.report}, {}
130
+ )
131
else:
132
self.report()
0 commit comments