Skip to content

Commit

Permalink
Remove Py27 tempfile hack from setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
LSchueler committed Nov 19, 2019
1 parent 3f12bef commit f074473
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,6 @@ def find_version(*file_paths):
# https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/_build_utils/openmp_helpers.py


class _TemporaryDirectory:
def __enter__(self):
self.dir_name = tempfile.mkdtemp()
return self.dir_name

def __exit__(self, exc_type, exc_value, traceback):
shutil.rmtree(self.dir_name)


TemporaryDirectory = getattr(
tempfile, "TemporaryDirectory", _TemporaryDirectory
)

CCODE = """
#include <omp.h>
#include <stdio.h>
Expand Down Expand Up @@ -99,7 +86,7 @@ def check_openmp_support():
ccompiler = new_compiler()
customize_compiler(ccompiler)

with TemporaryDirectory() as tmp_dir:
with tempfile.TemporaryDirectory() as tmp_dir:
try:
os.chdir(tmp_dir)
# Write test program
Expand Down

0 comments on commit f074473

Please sign in to comment.