Skip to content

Commit

Permalink
Update windows tk work-a-round: pypa/virtualenv#93
Browse files Browse the repository at this point in the history
untested
  • Loading branch information
jedie committed Oct 1, 2020
1 parent f68b912 commit 442aab2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions dragonpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import imp
import os
import sys

Expand Down Expand Up @@ -55,11 +54,14 @@ def fix_virtualenv_tkinter():
virtualprefix = sys.base_prefix
sys.base_prefix = sys.real_prefix

from tkinter import _fix

if "TCL_LIBRARY" not in os.environ:
from imp import reload
imp.reload(_fix)
try:
from tkinter import _fix
except ImportError as err:
print(f'Can not apply windows tkinter fix: {err}')
else:
if "TCL_LIBRARY" not in os.environ:
from importlib import reload
reload(_fix)

sys.base_prefix = virtualprefix

Expand Down

0 comments on commit 442aab2

Please sign in to comment.