Skip to content

Commit

Permalink
fix not a package type error for importlib (#193)
Browse files Browse the repository at this point in the history
* fix not a package type error for importlib

* [pre-commit.ci] auto fixes from pre-commit hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Tieqiong and pre-commit-ci[bot] authored Aug 22, 2024
1 parent aeca43d commit 905a37f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/diffpy/pdfgui/gui/pdfguiglobals.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
isAltered = False

# Resolve APPDATADIR base path to application data files.
_mydir = os.path.abspath(str(files(__name__)))
try:
_mydir = os.path.abspath(str(files(__name__)))
except TypeError: # For Python < 3.12
_mydir = os.path.abspath(os.path.dirname(__file__))

_upbasedir = os.path.normpath(_mydir + "/../../..")
_development_mode = os.path.basename(_upbasedir) == "src" and os.path.isfile(
os.path.join(_upbasedir, "../pyproject.toml")
Expand Down

0 comments on commit 905a37f

Please sign in to comment.