Explorar el Código

Move the federated check back up to the top of the uninstall code.

Since federated extensions mask other extensions, we should error out right away if there is a federated extension. Otherwise, we might uninstall the hidden extension the federated extension is masking.
Jason Grout hace 4 años
padre
commit
82db5294d6
Se han modificado 1 ficheros con 4 adiciones y 3 borrados
  1. 4 3
      jupyterlab/commands.py

+ 4 - 3
jupyterlab/commands.py

@@ -816,6 +816,10 @@ class _AppHandler(object):
         info = self.info
         logger = self.logger
 
+        if name in info['federated_exts']:
+            logger.warn('%s was installed with a package manager. Use the same package manager to uninstall this extension.' % name)
+            return False
+
         # Allow for uninstalled core extensions.
         if name in info['core_extensions']:
             config = self._read_build_config()
@@ -844,9 +848,6 @@ class _AppHandler(object):
                     self._write_build_config(config)
                 return True
 
-        if name in info['federated_exts']:
-            logger.warn('%s was installed with a package manager. Use the same package manager to uninstall this extension.' % name)
-
         logger.warn('No labextension named "%s" installed' % name)
         return False