FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Replaced ASSERT statements with if statements raising valueERROR by shafi456 · Pull Request #71 · aboutcode-org/extractcode · GitHub

Replaced ASSERT statements with if statements raising valueERROR - #71

Open
shafi456 wants to merge 1 commit into
aboutcode-org:mainfrom
shafi456:shafi456/175
Open

Replaced ASSERT statements with if statements raising valueERROR#71
shafi456 wants to merge 1 commit into
aboutcode-org:mainfrom
shafi456:shafi456/175

Conversation

shafi456 commented Jan 31, 2025
edited
Loading

Copy link
Copy Markdown

Fixes issue in extracode repo: src/extractcode/uncompress.py

aboutcode-org/aboutcode#175

  1. Replaces assert with explicit exception handling
  2. Raises ValueError if inputs are invalid

Signed-off by Shafi456 (shafiul.azam@g.bracu.ac.bd)

shafi456 changed the title Replaced ASSERT statements with if statements raising valueERROR #175 Replaced ASSERT statements with if statements raising valueERROR Jan 31, 2025
# name when present.
assert location
assert decompressor
if not location: raise ValueError("Invalid file location: Location cannot be none or empty.")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Good. Can you also add a test?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Do you mean to add a unittest or pytest to verify that the new code behaves as expected?

pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL