raise special exception for dangling links

This commit is contained in:
ThomasV 2017-03-14 08:56:30 +01:00
parent b27aeadb71
commit cb2d5ff3d6
2 changed files with 3 additions and 0 deletions

View File

@ -353,6 +353,7 @@ if __name__ == '__main__':
sys.exit(1)
config_options['url'] = uri
# todo: defer this to gui
config = SimpleConfig(config_options)
cmdname = config.get('cmd')

View File

@ -161,6 +161,8 @@ class SimpleConfig(PrintError):
# default path
dirpath = os.path.join(self.path, "wallets")
if not os.path.exists(dirpath):
if os.path.islink(dirpath):
raise BaseException('Dangling link: ' + dirpath)
os.mkdir(dirpath)
new_path = os.path.join(self.path, "wallets", "default_wallet")