mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
relative import of ConfigManager
avoids wrong import on Python 2
This commit is contained in:
parent
4f3c65dbde
commit
2db0749cf3
@ -338,7 +338,7 @@ class EnableNBExtensionApp(JupyterApp):
|
||||
|
||||
def enable_nbextension(self, name):
|
||||
# Local import to avoid circular import issue on Py 2
|
||||
from notebook.services.config import ConfigManager
|
||||
from .services.config import ConfigManager
|
||||
cm = ConfigManager(parent=self, config=self.config)
|
||||
cm.update(self.section, {"load_extensions": {name: True}})
|
||||
|
||||
@ -369,7 +369,7 @@ class DisableNBExtensionApp(JupyterApp):
|
||||
|
||||
def disable_nbextension(self, name):
|
||||
# Local import to avoid circular import issue on Py 2
|
||||
from notebook.services.config import ConfigManager
|
||||
from .services.config import ConfigManager
|
||||
cm = ConfigManager(parent=self, config=self.config)
|
||||
if name not in cm.get(self.section).get('load_extensions', {}):
|
||||
sys.exit('{} is not enabled in section {}'.format(name, self.section))
|
||||
|
Loading…
Reference in New Issue
Block a user