Update security.py

This commit is contained in:
Bibo Hao 2019-11-25 03:33:16 +08:00 committed by GitHub
parent 8d43f50f04
commit 9775af7bba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,9 +118,10 @@ def persist_config(config_file=None, mode=0o600):
"""
if config_file is None:
os.makedirs(jupyter_config_dir(), exist_ok=True)
config_file = os.path.join(jupyter_config_dir(), 'jupyter_notebook_config.json')
os.makedirs(os.path.dirname(config_file), exist_ok=True)
loader = JSONFileConfigLoader(os.path.basename(config_file), os.path.dirname(config_file))
try:
config = loader.load_config()