1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-13 09:56:30 +00:00

fix tox build for environment-python != containing-python in yet-another instance

this instance: the repository worktree is *not* named borg.

Cherry pick of 4f1157c into 1.0-maint due to f3efcdb

TODO removed since we already did that after 1.0-maint, but 1.0-maint
will never receive the change.
This commit is contained in:
Marian Beermann 2016-11-13 11:19:58 +01:00
parent 1a0218b50f
commit 960c42193a
No known key found for this signature in database
GPG key ID: 9B8450B91D1362C1

View file

@ -1,4 +1,5 @@
import os import os
import os.path
import sys import sys
import pytest import pytest
@ -10,12 +11,10 @@
# The workaround is to remove entries pointing there from the path and check whether "borg" # The workaround is to remove entries pointing there from the path and check whether "borg"
# is still importable. If it is not, then it has not been installed in the environment # is still importable. If it is not, then it has not been installed in the environment
# and the entries are put back. # and the entries are put back.
#
# TODO: After moving the package to src/: remove this.
original_path = list(sys.path) original_path = list(sys.path)
for entry in original_path: for entry in original_path:
if entry == '' or entry.endswith('/borg'): if entry == '' or entry == os.path.dirname(__file__):
sys.path.remove(entry) sys.path.remove(entry)
try: try: