Sfoglia il codice sorgente

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 4 anni fa
parent
commit
82db5294d6
1 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  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