Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STY: Change if to elif #2968

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

STY: Change if to elif #2968

wants to merge 2 commits into from

Conversation

j-t-1
Copy link
Contributor

@j-t-1 j-t-1 commented Nov 27, 2024

Increases readability.

Increases readability.
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.36%. Comparing base (5b80cbb) to head (3254996).

Files with missing lines Patch % Lines
pypdf/_encryption.py 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2968   +/-   ##
=======================================
  Coverage   96.36%   96.36%           
=======================================
  Files          52       52           
  Lines        8746     8746           
  Branches     1590     1590           
=======================================
  Hits         8428     8428           
  Misses        190      190           
  Partials      128      128           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -941,10 +942,10 @@ def _make_crypt_filter(self, idnum: int, generation: int) -> CryptFilter:
def _get_crypt(
method: str, rc4_key: bytes, aes128_key: bytes, aes256_key: bytes
) -> CryptBase:
if method == "/AESV3":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to not use elif here, but plain if statements. IMHO it is bad code style to have elif when every branch returns directly anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amended: removed the elif.

Slight increase of readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants