Uninstalls by restoring System.out and System.err.
543062
public static void uninstall() {
        synchronized (log()) {
            if (cInstalled) {
                cInstalled = false;
                System.setOut(cOriginalOut);
                System.setErr(cOriginalErr);
                cOriginalOut = null;
                cOriginalErr = null;
                cSystemOut = null;
                cSystemErr = null;
            }
        }
    }
1283662
function uninstall(deps, options, exec) {
	options = options || {};
	deps = _.castArray(deps);
	const dev = options.dev !== false;
	const run = options.yarn || isUsingYarn() ? runYarn : runNpm;

	const installed = getOwnDependencies({ dev });

	const newDeps = deps.filter(dep => installed[dep]);

	if (newDeps.length === 0) {
		return;
	}

	log.info(`Uninstalling ${listify(newDeps)}...`);
	run(newDeps, { remove: true, dev }, exec);
}
252655
def _cleanup(self):
        """"""
        self._expkg = None
        self._extmp = None
        self._flag_e = True
        self._ifile.close()
852990
def uninstall(args, env, console, ciprcfg):
    
    for name in args:
        package_dir = path.join(env.package_dir, name)
        if path.exists(package_dir):
            console.quiet('Removing %s...' % name)
            if path.islink(package_dir):
                os.remove(package_dir)
            else:
                shutil.rmtree(package_dir)

        ciprcfg.remove_package(name)
14655
def rollback(self):
        """"""
        for p in self._moves:
            logging.info("Moving to %s\n from %s", *p)

        for new_path, path in self._moves:
            try:
                logger.debug('Replacing %s from %s', new_path, path)
                if os.path.isfile(new_path):
                    os.unlink(new_path)
                elif os.path.isdir(new_path):
                    rmtree(new_path)
                renames(path, new_path)
            except OSError as ex:
                logger.error("Failed to restore %s", new_path)
                logger.debug("Exception: %s", ex)

        self.commit()
222628
def uninstall(
    ctx,
    state,
    all_dev=False,
    all=False,
    **kwargs
):
    """"""
    from ..core import do_uninstall
    retcode = do_uninstall(
        packages=state.installstate.packages,
        editable_packages=state.installstate.editables,
        three=state.three,
        python=state.python,
        system=state.system,
        lock=not state.installstate.skip_lock,
        all_dev=all_dev,
        all=all,
        keep_outdated=state.installstate.keep_outdated,
        pypi_mirror=state.pypi_mirror,
        ctx=ctx
    )
    if retcode:
        sys.exit(retcode)
789587
def uninstalled(name):
    '''
    

    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    zones = __salt__['zoneadm.list'](installed=True, configured=True)
    if name in zones:
        if zones[name]['state'] != 'configured':
            if __opts__['test']:
                res_uninstall = {'status': True}
            else:
                res_uninstall = __salt__['zoneadm.uninstall'](name)
            ret['result'] = res_uninstall['status']
            if ret['result']:
                ret['changes'][name] = 'uninstalled'
                ret['comment'] = 'The zone {0} was uninstalled.'.format(name)
            else:
                ret['comment'] = []
                ret['comment'].append('Failed to uninstall zone {0}!'.format(name))
                if 'message' in res_uninstall:
                    ret['comment'].append(res_uninstall['message'])
                ret['comment'] = "\n".join(ret['comment'])
        else:
            ret['result'] = True
            ret['comment'] = 'zone {0} already uninstalled.'.format(name)
    else:
        ## note: a non existing zone is not installed, we do not consider this a failure
        ret['result'] = True
        ret['comment'] = 'zone {0} is not configured!'.format(name)

    return ret
1123130
public function uninstall()
    {
        $this->assertIsDebugMode();
	    try {
	        $uninstaller = new \tao_install_ExtensionUninstaller($this->getCurrentExtension());
	        $success = $uninstaller->uninstall();
	        $message = __('Uninstalled %s', $this->getRequestParameter('id'));
	    } catch (\common_Exception $e) {
	        $success = false;
	        if ($e instanceof \common_exception_UserReadableException) {
	            $message = $e->getUserMessage();
	        } else {
	            $message = __('Uninstall of %s failed', $this->getRequestParameter('id'));
	        }
	    }
        $this->returnJson(array(
	        'success' => $success,
	        'message' => $message
	    ));
	}
955658
public function uninstall_cleanup() {
        global $CFG;

        if (!empty($CFG->antiviruses)) {
            $antiviruses = explode(',', $CFG->antiviruses);
            $antiviruses = array_unique($antiviruses);
        } else {
            $antiviruses = array();
        }
        if (($key = array_search($this->name, $antiviruses)) !== false) {
            unset($antiviruses[$key]);
            set_config('antiviruses', implode(',', $antiviruses));
        }
        parent::uninstall_cleanup();
    }
826753
public static function unregister()
    {
        $nc = '\\' . get_called_class();

        App::off('error',     array( $nc, 'renderError' ));
        App::off('terminate', array( $nc, 'renderPerformance' ));
        App::off('terminate', array( $nc, 'renderClasses' ));

        if (false === empty(self::$displayErrors)) {
            function_exists('init_set') && ini_set('display_errors', self::$displayErrors);

            self::$displayErrors = null;
        }
    }
591288
def exit_with_error(self, error, **kwargs):
        
        self.error(error, **kwargs)
        raise SystemExit(error)
114178
def uninstalled(name):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': False,
           'comment': ''}

    # Is the KB already uninstalled
    if not __salt__['wusa.is_installed'](name):
        ret['result'] = True
        ret['comment'] = '{0} already uninstalled'.format(name)
        return ret

    # Check for test=True
    if __opts__['test'] is True:
        ret['result'] = None
        ret['comment'] = '{0} would be uninstalled'.format(name)
        ret['result'] = None
        return ret

    # Uninstall the KB
    __salt__['wusa.uninstall'](name)

    # Verify successful uninstall
    if not __salt__['wusa.is_installed'](name):
        ret['comment'] = '{0} was uninstalled'.format(name)
        ret['changes'] = {'old': True, 'new': False}
        ret['result'] = True
    else:
        ret['comment'] = '{0} failed to uninstall'.format(name)

    return ret
779547
def _uninstall(action='remove', name=None, pkgs=None, **kwargs):
    '''
    
    '''
    try:
        pkg_params = __salt__['pkg_resource.parse_targets'](name, pkgs)[0]
    except MinionError as exc:
        raise CommandExecutionError(exc)

    old = list_pkgs()
    old_removed = list_pkgs(removed=True)
    targets = [x for x in pkg_params if x in old]
    if action == 'purge':
        targets.extend([x for x in pkg_params if x in old_removed])
    if not targets:
        return {}
    cmd = ['apt-get', '-q', '-y', action]
    cmd.extend(targets)
    env = _parse_env(kwargs.get('env'))
    env.update(DPKG_ENV_VARS.copy())
    out = _call_apt(cmd, env=env)
    if out['retcode'] != 0 and out['stderr']:
        errors = [out['stderr']]
    else:
        errors = []

    __context__.pop('pkg.list_pkgs', None)
    new = list_pkgs()
    new_removed = list_pkgs(removed=True)

    changes = salt.utils.data.compare_dicts(old, new)
    if action == 'purge':
        ret = {
            'removed': salt.utils.data.compare_dicts(old_removed, new_removed),
            'installed': changes
        }
    else:
        ret = changes

    if errors:
        raise CommandExecutionError(
            'Problem encountered removing package(s)',
            info={'errors': errors, 'changes': ret}
        )

    return ret
527439
public function cmdUninstallModule()
    {
        $result = $this->module_model->uninstall($this->getParam(0));

        if ($result !== true) {
            $this->errorAndExit($result);
        }

        $this->output();
    }
657824
def uninstall(python=PYTHON):
    """"""
    site_packages = local(
        "{python} -c 'from distutils.sysconfig import "
        "get_python_lib; print(get_python_lib())'".format(python=python),
        capture=True,
    )
    with lcd(site_packages):
        local("sudo rm mpfr.so")
        local("sudo rm -fr bigfloat")
        local("sudo rm bigfloat*.egg-info")
1192446
def uninstall(self, package: str) -> None:
        ''''''
        if package not in self.view_packgets_list():
            raise NoSuchPackageException(
                f'There is no such package {package!r}.')
        self._execute('-s', self.device_sn, 'uninstall', package)
557946
def on_uninstall(self):
        """"""
        self._on_close = True
        self.enabled = False
        self._editor = None