PNG  IHDR* pHYs+ IDATx]n#; cdLb Ǚ[at¤_:uP}>!Usă cag޿ ֵNu`ݼTâabO7uL&y^wFٝA"l[|ŲHLN밪4*sG3|Dv}?+y߉{OuOAt4Jj.u]Gz*҉sP'VQKbA1u\`& Af;HWj hsO;ogTu uj7S3/QzUr&wS`M$X_L7r2;aE+ώ%vikDA:dR+%KzƉo>eOth$z%: :{WwaQ:wz%4foɹE[9<]#ERINƻv溂E%P1i01 |Jvҗ&{b?9g=^wζXn/lK::90KwrюO\!ջ3uzuGv^;騢wq<Iatv09:tt~hEG`v;3@MNZD.1]L:{ծI3`L(÷ba")Y.iljCɄae#I"1 `3*Bdz>j<fU40⨬%O$3cGt]j%Fߠ_twJ;ABU8vP3uEԑwQ V:h%))LfraqX-ۿX]v-\9I gl8tzX ]ecm)-cgʒ#Uw=Wlێn(0hPP/ӨtQ“&J35 $=]r1{tLuǮ*i0_;NƝ8;-vݏr8+U-kruȕYr0RnC]*ެ(M:]gE;{]tg(#ZJ9y>utRDRMdr9㪩̞zֹb<ģ&wzJM"iI( .ꮅX)Qw:9,i좜\Ԛi7&N0:asϓc];=ΗOӣ APqz93 y $)A*kVHZwBƺnWNaby>XMN*45~ղM6Nvm;A=jֲ.~1}(9`KJ/V F9[=`~[;sRuk]rєT!)iQO)Y$V ی ۤmzWz5IM Zb )ˆC`6 rRa}qNmUfDsWuˤV{ Pݝ'=Kֳbg,UҘVz2ﴻnjNgBb{? ߮tcsͻQuxVCIY۠:(V뺕 ٥2;t`@Fo{Z9`;]wMzU~%UA蛚dI vGq\r82iu +St`cR.6U/M9IENDB` REDROOM
PHP 5.6.40
Preview: fix_raise.py Size: 2.86 KB
/opt/alt/python-internal/lib64/python3.11/lib2to3/fixes/fix_raise.py

"""Fixer for 'raise E, V, T'

raise         -> raise
raise E       -> raise E
raise E, V    -> raise E(V)
raise E, V, T -> raise E(V).with_traceback(T)
raise E, None, T -> raise E.with_traceback(T)

raise (((E, E'), E''), E'''), V -> raise E(V)
raise "foo", V, T               -> warns about string exceptions


CAVEATS:
1) "raise E, V" will be incorrectly translated if V is an exception
   instance. The correct Python 3 idiom is

        raise E from V

   but since we can't detect instance-hood by syntax alone and since
   any client code would have to be changed as well, we don't automate
   this.
"""
# Author: Collin Winter

# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Name, Call, Attr, ArgList, is_tuple

class FixRaise(fixer_base.BaseFix):

    BM_compatible = True
    PATTERN = """
    raise_stmt< 'raise' exc=any [',' val=any [',' tb=any]] >
    """

    def transform(self, node, results):
        syms = self.syms

        exc = results["exc"].clone()
        if exc.type == token.STRING:
            msg = "Python 3 does not support string exceptions"
            self.cannot_convert(node, msg)
            return

        # Python 2 supports
        #  raise ((((E1, E2), E3), E4), E5), V
        # as a synonym for
        #  raise E1, V
        # Since Python 3 will not support this, we recurse down any tuple
        # literals, always taking the first element.
        if is_tuple(exc):
            while is_tuple(exc):
                # exc.children[1:-1] is the unparenthesized tuple
                # exc.children[1].children[0] is the first element of the tuple
                exc = exc.children[1].children[0].clone()
            exc.prefix = " "

        if "val" not in results:
            # One-argument raise
            new = pytree.Node(syms.raise_stmt, [Name("raise"), exc])
            new.prefix = node.prefix
            return new

        val = results["val"].clone()
        if is_tuple(val):
            args = [c.clone() for c in val.children[1:-1]]
        else:
            val.prefix = ""
            args = [val]

        if "tb" in results:
            tb = results["tb"].clone()
            tb.prefix = ""

            e = exc
            # If there's a traceback and None is passed as the value, then don't
            # add a call, since the user probably just wants to add a
            # traceback. See issue #9661.
            if val.type != token.NAME or val.value != "None":
                e = Call(exc, args)
            with_tb = Attr(e, Name('with_traceback')) + [ArgList([tb])]
            new = pytree.Node(syms.simple_stmt, [Name("raise")] + with_tb)
            new.prefix = node.prefix
            return new
        else:
            return pytree.Node(syms.raise_stmt,
                               [Name("raise"), Call(exc, args)],
                               prefix=node.prefix)

Directory Contents

Dirs: 1 × Files: 53

Name Size Perms Modified Actions
- drwxr-xr-x 2025-08-04 23:01:17
Edit Download
2.29 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
984 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
320 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
590 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
3.67 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
3.27 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
979 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
2.00 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
2.44 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
2.70 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
644 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
547 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
451 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
3.12 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
4.76 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
3.18 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
5.55 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
289 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
708 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
1.12 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
1.57 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
1.51 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
2.04 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
476 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
3.55 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
8.00 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
606 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
571 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
3.10 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
591 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
768 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
3.35 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
1.20 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
2.78 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
2.86 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
454 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
837 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
1.06 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
2.17 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
613 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
1.66 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
449 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
1.01 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
1.54 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
5.43 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
1.73 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
1.23 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
8.17 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
1.06 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
2.63 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
689 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download
1.26 KB lrw-r--r-- 2025-06-03 18:38:25
Edit Download
47 B lrw-r--r-- 2025-06-03 18:38:25
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 REDROOM — Secure File Manager. All rights reserved. Built with ❤️ & Red Dark UI