Skip to content

Commit 11c8654

Browse files
committed
DEPS: remove PY37 in benchmark (pandas-dev#34472)
1 parent 8ec1d0b commit 11c8654

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

asv_bench/benchmarks/package.py

+9-15
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,16 @@
44
import subprocess
55
import sys
66

7-
from pandas.compat import PY37
8-
97

108
class TimeImport:
119
def time_import(self):
12-
if PY37:
13-
# on py37+ we the "-X importtime" usage gives us a more precise
14-
# measurement of the import time we actually care about,
15-
# without the subprocess or interpreter overhead
16-
cmd = [sys.executable, "-X", "importtime", "-c", "import pandas as pd"]
17-
p = subprocess.run(cmd, stderr=subprocess.PIPE)
18-
19-
line = p.stderr.splitlines()[-1]
20-
field = line.split(b"|")[-2].strip()
21-
total = int(field) # microseconds
22-
return total
10+
# on py37+ we the "-X importtime" usage gives us a more precise
11+
# measurement of the import time we actually care about,
12+
# without the subprocess or interpreter overhead
13+
cmd = [sys.executable, "-X", "importtime", "-c", "import pandas as pd"]
14+
p = subprocess.run(cmd, stderr=subprocess.PIPE)
2315

24-
cmd = [sys.executable, "-c", "import pandas as pd"]
25-
subprocess.run(cmd, stderr=subprocess.PIPE)
16+
line = p.stderr.splitlines()[-1]
17+
field = line.split(b"|")[-2].strip()
18+
total = int(field) # microseconds
19+
return total

0 commit comments

Comments
 (0)