Skip to content

Commit

Permalink
ruff + a pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
pomponchik committed Nov 17, 2023
1 parent 9de8112 commit 1cf1085
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 14 deletions.
7 changes: 3 additions & 4 deletions instld/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import importlib
import inspect
from contextlib import contextmanager
from tempfile import TemporaryDirectory
from threading import RLock

import instld
Expand Down Expand Up @@ -74,7 +73,7 @@ def import_wrapper(name, *args, **kwargs):
with set_import():
try:
result = __import__(name, *args, **kwargs)
except (ModuleNotFoundError, ImportError) as e:
except (ModuleNotFoundError, ImportError):
current_context.install(package_name, catch_output=catch_output, **options)
result = current_context.import_here(base_name)
sys.modules[base_name] = result
Expand All @@ -92,7 +91,7 @@ def import_wrapper(name, *args, **kwargs):

if python_file is None:
try:
import readline
import readline # noqa: F401
except ImportError:
pass

Expand Down Expand Up @@ -125,4 +124,4 @@ def push(self, line):


if __name__ == "__main__":
start()
main()
1 change: 0 additions & 1 deletion instld/cli/parsing_arguments/get_python_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import sys


Expand Down
3 changes: 0 additions & 3 deletions instld/cli/traceback_cutting/cutting.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import io
import os
import sys
import traceback
from contextlib import redirect_stderr

from instld.cli.traceback_cutting.traceback_utils import cut_base_of_traceback

Expand Down
2 changes: 1 addition & 1 deletion instld/module/command_executer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
from threading import Thread, Lock
from subprocess import Popen, PIPE, CalledProcessError
from subprocess import Popen, PIPE

from instld.module.empty_logger import EmptyLogger
from instld.errors import RestartingCommandError, RunningCommandError
Expand Down
4 changes: 1 addition & 3 deletions instld/module/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ def new_path(self, module_name):
old_path = sys.path
sys.path = [self.where] + copy.copy(self.original_path)
if module_name in sys.modules:
old_module = sys.modules.pop(module_name)
else:
old_module = None
sys.modules.pop(module_name)
yield
sys.path = old_path

Expand Down
1 change: 0 additions & 1 deletion instld/module/context_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import tempfile
from functools import partial

from io import StringIO
from contextlib import contextmanager

from instld.errors import InstallingPackageError, RunningCommandError
Expand Down
1 change: 0 additions & 1 deletion tests/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import shutil

import pytest
from contextif import state


@pytest.mark.timeout(180)
Expand Down

0 comments on commit 1cf1085

Please sign in to comment.