Skip to content

Commit

Permalink
Check flake8 repport
Browse files Browse the repository at this point in the history
  • Loading branch information
Ni-g-3l committed Nov 11, 2024
1 parent f8a8f49 commit b3a7e86
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/rez/plugin_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,11 @@ def register_plugin_module(self, plugin_name, plugin_module, plugin_path):

plugin_class = plugin_module.register_plugin()
if plugin_class is not None:
self.register_plugin(plugin_name,
plugin_class,
plugin_module)
self.register_plugin(
plugin_name,
plugin_class,
plugin_module
)
else:
if config.debug("plugins"):
print_warning(
Expand Down
8 changes: 4 additions & 4 deletions src/rez/tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ def wrapper(self, *args, **kwargs):
return decorator



_restore_sys_path_lock = threading.Lock()
_restore_os_environ_lock = threading.Lock()
_restore_pip_lock = threading.Lock()
Expand Down Expand Up @@ -365,13 +364,14 @@ def restore_os_environ():
os.environ.clear()
os.environ.update(original)


@contextmanager
def restore_pip(package_name, package_path):
from pip._internal import main as pipmain

with _restore_pip_lock:
pipmain(['install', package_path])

yield True

pipmain(['uninstall', package_name, "-y"])
pipmain(['uninstall', package_name, "-y"])

0 comments on commit b3a7e86

Please sign in to comment.