Skip to content

Commit

Permalink
Drop patching class Path to add expanduser(): not needed with Python
Browse files Browse the repository at this point in the history
3.6 and newer
  • Loading branch information
RKrahl committed Aug 30, 2024
1 parent adfef6d commit 0785b9f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/icat/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@

__all__ = ['boolean', 'flag', 'Configuration', 'Config']

# Evil hack: Path.expanduser() has been added in Python 3.5.
# Monkeypatch the class for older Python versions.
if not hasattr(Path, "expanduser"):
import os.path
def _expanduser(p):
return Path(os.path.expanduser(str(p)))
Path.expanduser = _expanduser


if sys.platform.startswith("win"):
cfgdirs = [ Path(os.environ['ProgramData'], "ICAT"),
Expand Down

0 comments on commit 0785b9f

Please sign in to comment.