From dee6e63258ffa1d731a7161b62a8e28294af8462 2021-10-28 08:39:42 From: Julien Rabinow Date: 2021-10-28 08:39:42 Subject: [PATCH] add optional support for xdg_config|cache_dir --- diff --git a/IPython/paths.py b/IPython/paths.py index a2ea5bc..2dcb519 100644 --- a/IPython/paths.py +++ b/IPython/paths.py @@ -54,8 +54,7 @@ def get_ipython_dir() -> str: warn(('{0} is deprecated. Move link to {1} to ' 'get rid of this message').format(cu(xdg_ipdir), cu(ipdir))) else: - warn('Moving {0} to {1}'.format(cu(xdg_ipdir), cu(ipdir))) - shutil.move(xdg_ipdir, ipdir) + ipdir = xdg_ipdir ipdir = os.path.normpath(os.path.expanduser(ipdir)) diff --git a/IPython/utils/path.py b/IPython/utils/path.py index 273c519..55405cf 100644 --- a/IPython/utils/path.py +++ b/IPython/utils/path.py @@ -223,7 +223,7 @@ def get_xdg_dir(): env = os.environ - if os.name == 'posix' and sys.platform != 'darwin': + if os.name == "posix": # Linux, Unix, AIX, etc. # use ~/.config if empty OR not set xdg = env.get("XDG_CONFIG_HOME", None) or os.path.join(get_home_dir(), '.config') @@ -242,7 +242,7 @@ def get_xdg_cache_dir(): env = os.environ - if os.name == 'posix' and sys.platform != 'darwin': + if os.name == "posix": # Linux, Unix, AIX, etc. # use ~/.cache if empty OR not set xdg = env.get("XDG_CACHE_HOME", None) or os.path.join(get_home_dir(), '.cache')