Skip to content

Commit

Permalink
Drop usage of pkg_resources for dottedfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
amol- committed Mar 13, 2024
1 parent 0dfb89b commit 84fc736
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tg/util/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
import os, sys
import re
import uuid
import tempfile
import importlib.resources

from pkg_resources import get_default_cache

from .._compat import unicode_text, PY2


Expand Down Expand Up @@ -87,8 +86,7 @@ def get_dotted_filename(self, template_name, template_extension='.html'):
else:
# importing from a zipfile or py2exe
if not hasattr(self, '__temp_dir'):
self.__temp_dir = os.path.join(get_default_cache(),
'tgdf-%s' % uuid.uuid1())
self.__temp_dir = tempfile.mkdtemp()

result = os.path.join(self.__temp_dir, package, resourcename)
if not os.path.isdir(os.path.dirname(result)):
Expand Down

0 comments on commit 84fc736

Please sign in to comment.