File tree Expand file tree Collapse file tree 4 files changed +5
-6
lines changed Expand file tree Collapse file tree 4 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ install:
5454 )
5555 - pip install nose ddt wheel codecov
5656 - IF "%PYTHON_VERSION%"=="2.7" (
57- pip install mock contextlib2 backports.tempfile
57+ pip install mock contextlib2
5858 )
5959
6060 # # Copied from `init-tests-after-clone.sh`.
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ install:
1818 - git submodule update --init --recursive
1919 - git fetch --tags
2020 - pip install codecov flake8 ddt sphinx
21- - if [ "$TRAVIS_PYTHON_VERSION" == '2.7' ]; then pip install mock contextlib2 backports.tempfile ; fi
21+ - if [ "$TRAVIS_PYTHON_VERSION" == '2.7' ]; then pip install mock contextlib2; fi
2222
2323 # generate some reflog as git-python tests need it (in master)
2424 - ./init-tests-after-clone.sh
Original file line number Diff line number Diff line change 2323try :
2424 from unittest import mock
2525 from contextlib import ExitStack
26- from tempfile import TemporaryDirectory
2726except ImportError : # PY2
2827 import mock
2928 from contextlib2 import ExitStack # @UnusedImport
30- from backports .tempfile import TemporaryDirectory # @UnusedImport
3129
3230
3331ospd = osp .dirname
@@ -244,7 +242,9 @@ def cleanup_clone(repo):
244242 gc .collect ()
245243
246244 with ExitStack () as stack :
247- clone_dir = stack .enter_context (TemporaryDirectory (prefix = clone_prefix ))
245+ clone_dir = tempfile .mkdtemp (prefix = clone_prefix )
246+ stack .callback (rmtree , clone_dir )
247+
248248 clone = repo .clone (clone_dir , ** clone_kwargs )
249249 stack .callback (cleanup_clone , clone )
250250
Original file line number Diff line number Diff line change 11gitdb >= 0.6.4
22mock # PY2 only
33contextlib2 # PY2 only
4- backports.tempfile # PY2 only
You can’t perform that action at this time.
0 commit comments