Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restores the working directory #43

Merged
merged 1 commit into from
Jul 16, 2022
Merged

Restores the working directory #43

merged 1 commit into from
Jul 16, 2022

Conversation

giswqs
Copy link
Member

@giswqs giswqs commented Jul 16, 2022

Running WBT tools will change the current working directory due to os.chdir(self.exe_path). This is causing issues for other packages affected by the working directory. This PR restores the working directory after running a WBT tool.

try:
    work_dir = os.getcwd()
    os.chdir(self.exe_path)
except (OSError, ValueError, CalledProcessError) as err:
    callback(str(err))
    return 1
finally:
    os.chdir(work_dir)

@giswqs giswqs merged commit 5f0018b into master Jul 16, 2022
@giswqs giswqs deleted the chdir branch July 16, 2022 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant