seq: Use `parser.error()` for reporting invalid decimal arguments · Expertcoderz/python-userland@fec7af9 · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Commit fec7af9

Browse files
committed
seq: Use parser.error() for reporting invalid decimal arguments
1 parent 13d23b4 commit fec7af9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

userland/utilities/seq.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import math
2-
import sys
32
from decimal import Decimal, InvalidOperation
43

54
from .. import core
@@ -45,12 +44,9 @@ def python_userland_seq(opts, args):
4544

4645
def arg_to_decimal(arg: str) -> Decimal:
4746
try:
48-
return Decimal(
49-
arg,
50-
)
47+
return Decimal(arg)
5148
except InvalidOperation:
52-
print(f"invalid decimal argument: {arg}", file=sys.stderr)
53-
sys.exit(1)
49+
parser.error(f"invalid decimal argument: {arg}")
5450

5551
if len(args) == 1:
5652
first = Decimal(1)

0 commit comments

Comments
 (0)

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.