Skip to content

Commit

Permalink
chore: Code simplification via flake8-simplify (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
jirimoravcik authored Aug 4, 2023
1 parent b48d049 commit 0683783
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dev = [
"flake8-noqa ~= 1.3.1",
"flake8-pytest-style ~= 1.7.2",
"flake8-quotes ~= 3.3.2",
"flake8-simplify ~= 0.20.0",
"flake8-unused-arguments ~= 0.0.13",
"isort ~= 5.12.0",
"mypy ~= 1.3.0",
Expand Down
5 changes: 2 additions & 3 deletions src/apify_client/_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
class _WithLogDetailsClient(type):
def __new__(cls: Type[type], name: str, bases: Tuple, attrs: Dict) -> '_WithLogDetailsClient':
for attr_name, attr_value in attrs.items():
if not attr_name.startswith('_'):
if inspect.isfunction(attr_value):
attrs[attr_name] = _injects_client_details_to_log_context(attr_value)
if not attr_name.startswith('_') and inspect.isfunction(attr_value):
attrs[attr_name] = _injects_client_details_to_log_context(attr_value)

return cast(_WithLogDetailsClient, type.__new__(cls, name, bases, attrs))

Expand Down

0 comments on commit 0683783

Please sign in to comment.