mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 09:56:05 -05:00
appdirs<1.4.4 compatibility fix
This commit is contained in:
@@ -44,6 +44,13 @@ if sys.platform == "linux":
|
||||
if not config_dir:
|
||||
config_dir = Path(appdir.user_config_dir)
|
||||
config_file = config_dir / "config.json"
|
||||
if not config_file.exists() and sys.platform == "darwin":
|
||||
# backwards compatibility with the location given by appdirs<1.4.4
|
||||
# which was the same as user_data_dir
|
||||
# https://github.com/ActiveState/appdirs/issues/63
|
||||
_old_config_location = Path(appdir.user_data_dir) / "config.json"
|
||||
if _old_config_location.exists():
|
||||
_old_config_location.rename(config_file)
|
||||
|
||||
|
||||
def create_temp_config():
|
||||
|
||||
@@ -32,6 +32,13 @@ except PermissionError:
|
||||
print("You don't have permission to write to '{}'\nExiting...".format(config_dir))
|
||||
sys.exit(1)
|
||||
config_file = config_dir / "config.json"
|
||||
if not config_file.exists() and sys.platform == "darwin":
|
||||
# backwards compatibility with the location given by appdirs<1.4.4
|
||||
# which was the same as user_data_dir
|
||||
# https://github.com/ActiveState/appdirs/issues/63
|
||||
_old_config_location = Path(appdir.user_data_dir) / "config.json"
|
||||
if _old_config_location.exists():
|
||||
_old_config_location.rename(config_file)
|
||||
|
||||
|
||||
def load_existing_config():
|
||||
|
||||
Reference in New Issue
Block a user