Skip to content

Commit c0053d4

Browse files
author
Kevin D Smith
committed
Reset TKPATH after initialization (Windows only)
1 parent 332afb0 commit c0053d4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

swat/clib.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,12 @@ def InitializeTK(*args, **kwargs):
137137
''' Initialize the TK subsystem (importing _pyswat as needed) '''
138138
if _pyswat is None:
139139
_import_pyswat()
140-
return _pyswat.InitializeTK(*args, **kwargs)
140+
out = _pyswat.InitializeTK(*args, **kwargs)
141+
# Override TKPATH after initialization so that other TK applications
142+
# won't be affected.
143+
if sys.platform.lower().startswith('win') and 'TKPATH' not in os.environ:
144+
os.environ['TKPATH'] = os.pathsep
145+
return out
141146

142147

143148
def errorcheck(expr, obj):

0 commit comments

Comments
 (0)