Skip to content

Commit 157fd46

Browse files
Address picnixz review: single-line _raise_error call, move comment above with, drop redundant parens
1 parent 22b0491 commit 157fd46

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎Lib/_pydecimal.py‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,11 +1773,10 @@ def _fix(self, context):
17731773
coeff = coeff[:-1]
17741774
exp_min += 1
17751775

1776+
# check if rounding pushed the exponent out of range
17761777
with context._defer_traps():
1777-
# check if rounding pushed the exponent out of range
17781778
if exp_min > Etop:
1779-
ans = context._raise_error(Overflow, 'above Emax',
1780-
self._sign)
1779+
ans = context._raise_error(Overflow, 'above Emax', self._sign)
17811780
else:
17821781
ans = _dec_from_triple(self._sign, coeff, exp_min)
17831782

@@ -2564,8 +2563,7 @@ def __pow__(self, other, modulo=None, context=None):
25642563
with context._defer_traps():
25652564
if newcontext.flags[Overflow]:
25662565
context._raise_error(Overflow, 'above Emax', ans._sign)
2567-
for exception in (Underflow, Subnormal, Inexact, Rounded,
2568-
Clamped):
2566+
for exception in Underflow, Subnormal, Inexact, Rounded, Clamped:
25692567
if newcontext.flags[exception]:
25702568
context._raise_error(exception)
25712569

0 commit comments

Comments
 (0)