Skip to content

Commit 1f80cb2

Browse files
committed
a bit of refactoring
1 parent 972b254 commit 1f80cb2

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/_actions/install_rootfs/_installer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def _transform_member(member: tarfile.TarInfo):
135135
_attributes = dict(member.get_info())
136136
_path = _normalize_path(_attributes.pop("name"), drop_root = True).as_posix()
137137
if member.isdir(): _path = _path.rstrip("/")
138-
if not _path.strip("."): return
138+
if not _path.strip("."): return None
139139
member = tarfile.TarInfo(name = _path)
140140
for _key, _value in _attributes.items(): setattr(member, _key, _value)
141141
_uid, _gid = member.uid, member.gid

src/_actions/make_rootfs/_script_processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def _routine():
100100
assert isinstance(_action, str)
101101
if "main" == _action: return _main_action_routine(payload = _payload)
102102
assert "chroot" == _action
103-
_chroot_action_routine(payload = _payload)
103+
return _chroot_action_routine(payload = _payload)
104104

105105
class _Result(object):
106106
routine = _routine

src/_common/context_manipulator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def close(self, asynchronous: bool = None, exception_info = None):
4646
assert self.__manager is not None, "not opened"
4747
assert self.__asynchronous is asynchronous
4848
if asynchronous: return self.__async_close(**_keywords)
49-
self.__sync_close(**_keywords)
49+
return self.__sync_close(**_keywords)
5050

5151
def __init__(self, asynchronous: bool = False):
5252
assert isinstance(asynchronous, bool)

tests/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
def pytest_addoption(parser):
2-
parser.addoption("--tests.examples.nginx-source", required = False, action = "append", help = "OCI image path")
1+
def pytest_addoption(parser): parser.addoption(
2+
"--tests.examples.nginx-source", required = False, action = "append", help = "OCI image path"
3+
)

0 commit comments

Comments
 (0)