Skip to content

fix: ensure exit() is called for invalid units in correlateRC.py#4055

Merged
eder-matheus merged 1 commit into
The-OpenROAD-Project:masterfrom
ashnaaseth2325-oss:fix/correlateRC-exit-noop
Mar 25, 2026
Merged

fix: ensure exit() is called for invalid units in correlateRC.py#4055
eder-matheus merged 1 commit into
The-OpenROAD-Project:masterfrom
ashnaaseth2325-oss:fix/correlateRC-exit-noop

Conversation

@ashnaaseth2325-oss

Copy link
Copy Markdown
Contributor

SUMMARY

Fixes a small bug in correlateRC.py where exit wasn’t actually being called. The script now stops immediately on invalid units instead of crashing later.


FIX

Before

print("unknown resistance unit")
exit

After

print("unknown resistance unit")
exit(1)

VERIFICATION

Run with an invalid unit:

python3 flow/util/correlateRC.py -res_unit mΩ

Now: prints error and exits
Before: continued → NameError

exit without parentheses is a no-op in Python; replace with exit(1)
so invalid res_unit/cap_unit arguments terminate the script immediately
instead of continuing with undefined res_scale/cap_scale variables.

Signed-off-by: Ashnaa Seth <ashnaaseth2325@gmail.com>
Signed-off-by: ashnaaseth2325-oss <ashnaaseth2325@gmail.com>
@ashnaaseth2325-oss ashnaaseth2325-oss force-pushed the fix/correlateRC-exit-noop branch from 101c338 to 0b68105 Compare March 25, 2026 20:23
@ashnaaseth2325-oss

Copy link
Copy Markdown
Contributor Author

Hi @eder-matheus @maliberty,
Please review this PR whenever you get time.
Thanks!

@ashnaaseth2325-oss

Copy link
Copy Markdown
Contributor Author

@eder-matheus
Thanks for the approval.
Is it ready to merge?

@eder-matheus

Copy link
Copy Markdown
Member

@eder-matheus Thanks for the approval. Is it ready to merge?

The Jenkins pipelines didn't finished yet. I'll merge once it finishes...

@eder-matheus eder-matheus enabled auto-merge March 25, 2026 21:44
@eder-matheus eder-matheus merged commit 2567322 into The-OpenROAD-Project:master Mar 25, 2026
9 checks passed
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