From 2db0749cf3cc7569f2a9c4ef49b4821003340430 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 14 Aug 2015 10:07:08 -0700 Subject: [PATCH] relative import of ConfigManager avoids wrong import on Python 2 --- notebook/nbextensions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notebook/nbextensions.py b/notebook/nbextensions.py index a9ea2c5e2..dc1ffecdc 100644 --- a/notebook/nbextensions.py +++ b/notebook/nbextensions.py @@ -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))