Skip to content

Commit

Permalink
refactor: Apply suggestions by @jkowalleck
Browse files Browse the repository at this point in the history
Signed-off-by: Mostafa Moradian <mostafamoradian0@gmail.com>
  • Loading branch information
mostafa committed Mar 9, 2022
1 parent 684d4f0 commit 90b336f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cyclonedx_py/parser/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@ def __init__(self, requirements_content: str) -> None:

for requirement in parsed_rf.requirements:
name = requirement.link.url if requirement.is_local_path else requirement.name
version = (
requirement.get_pinned_version
if requirement.get_pinned_version
else requirement.dumps_specifier())
hashes = [HashType.from_composite_str(hash) for hash in requirement.hash_options]
version = requirement.get_pinned_version or requirement.dumps_specifier()
hashes = map(HashType.from_composite_str, requirement.hash_options)

if not version and not requirement.is_local_path:
self._warnings.append(
Expand Down

0 comments on commit 90b336f

Please sign in to comment.