Skip to content

Commit df2302e

Browse files
authored
Merge pull request #1 from pavelanni/fix-pythonpath
fix empty PYTHONPATH issue
2 parents 1410fef + 26d1137 commit df2302e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,9 @@ cython_debug/
157157
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160-
#.idea/
160+
#.idea/
161+
162+
# Pyenv version setting
163+
.python-version
164+
# VS Code settings
165+
settings.json

thonnycontrib/black_formatter/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
import os
12
import subprocess
23
import sys
3-
import os
4-
54
from collections import namedtuple
6-
75
from tkinter.messagebox import showinfo
6+
87
from thonny import get_workbench
98
from thonny.running import get_front_interpreter_for_subprocess
109

@@ -45,7 +44,7 @@ def prepare_run_environment(self):
4544
binfolder = plugins_folder.replace("lib/python/site-packages", "bin")
4645

4746
os.environ["PYTHONPATH"] = plugins_folder + (
48-
":" + os.environ["PYTHONPATH"] if os.environ["PYTHONPATH"] else ""
47+
":" + os.environ["PYTHONPATH"] if "PYTHONPATH" in os.environ.keys() else ""
4948
)
5049
os.environ["PATH"] = binfolder + ":" + plugins_folder + ":" + os.environ["PATH"]
5150

0 commit comments

Comments
 (0)