ó
    ÞÅŸgÀ[  ã                   óX   • S SK r S SKJrJr  S SKJrJr   " S S\5      r " S S\5      r	g)é    N)ÚmessagesÚchecker)ÚTestCaseÚskipc                   óø  • \ rS rSrS rS rS rS rS r\	" S5      S 5       r
S	 rS
 rS rS r\	" S5      S 5       r\	" S5      S 5       rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS r S r!\	" S 5      S! 5       r"S" r#S# r$S$ r%S% r&S& r'S' r(S( r)S) r*S* r+S+ r,S, r-S- r.S. r/S/ r0S0 r1S1 r2S2 r3S3 r4S4 r5S5 r6S6 r7S7 r8S8 r9S9 r:S: r;S; r<S< r=S= r>S> r?S? r@S@ rASA rBSB rCSC rDSD rESE rFSFrGgG)HÚTesté   c                 óD   • U R                  S[        R                  5        g )NÚbar©ÚflakesÚmÚUndefinedName©Úselfs    Úc/var/www/blue/EV-Temp_rev04/venv/lib/python3.13/site-packages/pyflakes/test/test_undefined_names.pyÚtest_undefinedÚTest.test_undefined   s   € Ø�‰�Eœ1Ÿ?™?Õ+ó    c                 ó&   • U R                  S5        g )Nz[a for a in range(10) if a]©r   r   s    r   Útest_definedInListCompÚTest.test_definedInListComp   s   € Ø�‰Ð1Õ2r   c                 óD   • U R                  S[        R                  5        g )Nz2
        [a for a in range(10)]
        a
        r   r   s    r   Útest_undefinedInListCompÚTest.test_undefinedInListComp   s   € Ø�‰ð ô —O‘Oõ		%r   c                 ób   • U R                  S[        R                  [        R                  5        g)zpException names can't be used after the except: block.

The exc variable is unused inside the exception handler.zx
        try:
            raise ValueError('ve')
        except ValueError as exc:
            pass
        exc
        N©r   r   r   ÚUnusedVariabler   s    r   Útest_undefinedExceptionNameÚ Test.test_undefinedExceptionName   s&   € ð 	�‰ð ô �_‰_œa×.Ñ.õ	0r   c                 ó&   • U R                  S5        g)zƒLocals declared in except: blocks can be used after the block.

This shows the example in test_undefinedExceptionName is
different.zy
        try:
            raise ValueError('ve')
        except ValueError as exc:
            e = exc
        e
        Nr   r   s    r   Ú test_namesDeclaredInExceptBlocksÚ%Test.test_namesDeclaredInExceptBlocks!   ó   € ð
 	�‰ð õ 	r   z5error reporting disabled due to false positives belowc                 óD   • U R                  S[        R                  5        g)zÆException names obscure locals, can't be used after.

Last line will raise UnboundLocalError on Python 3 after exiting
the except: block. Note next two examples for false positives to
watch out for.z—
        exc = 'Original value'
        try:
            raise ValueError('ve')
        except ValueError as exc:
            pass
        exc
        Nr   r   s    r   Ú1test_undefinedExceptionNameObscuringLocalVariableÚ6Test.test_undefinedExceptionNameObscuringLocalVariable.   s   € ð 	�‰ð ô —O‘Oõ	%r   c                 ób   • U R                  S[        R                  [        R                  5        g)z™Exception names are unbound after the `except:` block.

Last line will raise UnboundLocalError.
The exc variable is unused inside the exception handler.
zž
        try:
            raise ValueError('ve')
        except ValueError as exc:
            pass
        print(exc)
        exc = 'Original value'
        Nr   r   s    r   Ú2test_undefinedExceptionNameObscuringLocalVariable2Ú7Test.test_undefinedExceptionNameObscuringLocalVariable2?   s&   € ð 	�‰ð ô �_‰_œa×.Ñ.õ	0r   c                 óD   • U R                  S[        R                  5        g)z Exception names obscure locals, can't be used after. Unless.

Last line will never raise UnboundLocalError because it's only
entered if no exception was raised.z¾
        exc = 'Original value'
        try:
            raise ValueError('ve')
        except ValueError as exc:
            print('exception logged')
            raise
        exc
        N©r   r   r   r   s    r   Ú?test_undefinedExceptionNameObscuringLocalVariableFalsePositive1ÚDTest.test_undefinedExceptionNameObscuringLocalVariableFalsePositive1N   ó    € ð
 	�‰ð ô ×Ñõ	r   c                 ó&   • U R                  S5        g)z7The exception name can be deleted in the except: block.z\
        try:
            pass
        except Exception as exc:
            del exc
        Nr   r   s    r   Útest_delExceptionInExceptÚTest.test_delExceptionInExcept]   ó   € à�‰ð õ 	r   c                 óD   • U R                  S[        R                  5        g)zµException names obscure locals, can't be used after. Unless.

Last line will never raise UnboundLocalError because `error` is
only falsy if the `except:` block has not been entered.zÿ
        exc = 'Original value'
        error = None
        try:
            raise ValueError('ve')
        except ValueError as exc:
            error = 'exception logged'
        if error:
            print(error)
        else:
            exc
        Nr-   r   s    r   Ú?test_undefinedExceptionNameObscuringLocalVariableFalsePositive2ÚDTest.test_undefinedExceptionNameObscuringLocalVariableFalsePositive2f   s    € ð
 	�‰ð ô ×Ñõ	r   c                 óD   • U R                  S[        R                  5        g)zÐException names obscure globals, can't be used after.

Last line will raise UnboundLocalError because the existence of that
exception name creates a local scope placeholder for it, obscuring any
globals, etc.zì
        exc = 'Original value'
        def func():
            try:
                pass  # nothing is raised
            except ValueError as exc:
                pass  # block never entered, exc stays unbound
            exc
        N©r   r   ÚUndefinedLocalr   s    r   Ú2test_undefinedExceptionNameObscuringGlobalVariableÚ7Test.test_undefinedExceptionNameObscuringGlobalVariablex   s    € ð 	�‰ð ô ×$Ñ$õ		&r   c                 óD   • U R                  S[        R                  5        g)ag  Exception names obscure globals, can't be used after.

Last line will raise NameError on Python 3 because the name is
locally unbound after the `except:` block, even if it's
nonlocal. We should issue an error in this case because code
only working correctly if an exception isn't raised, is invalid.
Unless it's explicitly silenced, see false positives below.a   
        exc = 'Original value'
        def func():
            global exc
            try:
                raise ValueError('ve')
            except ValueError as exc:
                pass  # block never entered, exc stays unbound
            exc
        Nr9   r   s    r   Ú3test_undefinedExceptionNameObscuringGlobalVariable2Ú8Test.test_undefinedExceptionNameObscuringGlobalVariable2Š   s    € ð 	�‰ð 	ô ×$Ñ$õ
	&r   c                 óD   • U R                  S[        R                  5        g)z™Exception names obscure globals, can't be used after. Unless.

Last line will never raise NameError because it's only entered
if no exception was raised.a  
        exc = 'Original value'
        def func():
            global exc
            try:
                raise ValueError('ve')
            except ValueError as exc:
                print('exception logged')
                raise
            exc
        Nr-   r   s    r   Ú@test_undefinedExceptionNameObscuringGlobalVariableFalsePositive1ÚETest.test_undefinedExceptionNameObscuringGlobalVariableFalsePositive1Ÿ   s    € ð
 	�‰ð 
ô ×Ñõ
	r   c                 óD   • U R                  S[        R                  5        g)z®Exception names obscure globals, can't be used after. Unless.

Last line will never raise NameError because `error` is only
falsy if the `except:` block has not been entered.aN  
        exc = 'Original value'
        def func():
            global exc
            error = None
            try:
                raise ValueError('ve')
            except ValueError as exc:
                error = 'exception logged'
            if error:
                print(error)
            else:
                exc
        Nr-   r   s    r   Ú@test_undefinedExceptionNameObscuringGlobalVariableFalsePositive2ÚETest.test_undefinedExceptionNameObscuringGlobalVariableFalsePositive2°   s    € ð
 	�‰ð ô ×Ñõ	r   c                 ó&   • U R                  S5        g )NzQ
        class a:
            def b():
                fu
        fu = 1
        r   r   s    r   Útest_functionsNeedGlobalScopeÚ"Test.test_functionsNeedGlobalScopeÄ   s   € Ø�‰ð õ 	r   c                 ó&   • U R                  S5        g )Nz	range(10)r   r   s    r   Útest_builtinsÚTest.test_builtinsÌ   s   € Ø�‰�KÕ r   c                 ó&   • U R                  S5        g)zU
C{WindowsError} is sometimes a builtin name, so no warning is emitted
for using it.
ÚWindowsErrorNr   r   s    r   Útest_builtinWindowsErrorÚTest.test_builtinWindowsErrorÏ   ó   € ð
 	�‰�NÕ#r   c                 ó&   • U R                  S5        g)z‡
Use of the C{__annotations__} in module scope should not emit
an undefined name warning when version is greater than or equal to 3.6.
Ú__annotations__Nr   r   s    r   Útest_moduleAnnotationsÚTest.test_moduleAnnotationsÖ   s   € ð
 	�‰Ð%Õ&r   c                 ó&   • U R                  S5        g)zP
Use of the C{__file__} magic global should not emit an undefined name
warning.
Ú__file__Nr   r   s    r   Útest_magicGlobalsFileÚTest.test_magicGlobalsFileÝ   ó   € ð
 	�‰�JÕr   c                 ó&   • U R                  S5        g)zT
Use of the C{__builtins__} magic global should not emit an undefined
name warning.
Ú__builtins__Nr   r   s    r   Útest_magicGlobalsBuiltinsÚTest.test_magicGlobalsBuiltinsä   rP   r   c                 ó&   • U R                  S5        g)zP
Use of the C{__name__} magic global should not emit an undefined name
warning.
Ú__name__Nr   r   s    r   Útest_magicGlobalsNameÚTest.test_magicGlobalsNameë   rY   r   c                 ód   • U R                  S[        R                  5        U R                  SSS9  g)zƒ
Use of the C{__path__} magic global should not emit an undefined name
warning, if you refer to it from a file called __init__.py.
Ú__path__zpackage/__init__.py)ÚfilenameNr   r   s    r   Útest_magicGlobalsPathÚTest.test_magicGlobalsPathò   s'   € ð
 	�‰�J¤§¡Ô0Ø�‰�JÐ)>ˆÒ?r   c                 ó¦   • U R                  S[        R                  5        U R                  S5        U R                  S[        R                  5        g)zj
Use of the C{__module__} magic builtin should not emit an undefined
name warning if used in class scope.
Ú
__module__z3
        class Foo:
            __module__
        zR
        class Foo:
            def bar(self):
                __module__
        Nr   r   s    r   Útest_magicModuleInClassScopeÚ!Test.test_magicModuleInClassScopeú   sC   € ð
 	�‰�L¤!§/¡/Ô2Ø�‰ð ô 	ð 	�‰ð ô �_‰_õ		r   c                 ó¦   • U R                  S[        R                  5        U R                  S5        U R                  S[        R                  5        g)zl
Use of the C{__qualname__} magic builtin should not emit an undefined
name warning if used in class scope.
Ú__qualname__z5
        class Foo:
            __qualname__
        zT
        class Foo:
            def bar(self):
                __qualname__
        Nr   r   s    r   Útest_magicQualnameInClassScopeÚ#Test.test_magicQualnameInClassScope
  sC   € ð
 	�‰�N¤A§O¡OÔ4Ø�‰ð ô 	ð 	�‰ð ô �_‰_õ		r   c                 ób   • U R                  S[        R                  [        R                  5        g)z)Can't find undefined names with import *.zfrom fu import *; barN)r   r   ÚImportStarUsedÚImportStarUsager   s    r   Útest_globalImportStarÚTest.test_globalImportStar  s"   € à�‰Ð+Ü×$Ñ$¤a×&7Ñ&7õ	9r   c                 óH   • U R                  S5        U R                  S5        g)zL
"global" can make an otherwise undefined name in another function
defined.
z@
        def a(): global fu; fu = 1
        def b(): fu
        zC
        def c(): bar
        def b(): global bar; bar = 1
        Nr   r   s    r   Útest_definedByGlobalÚTest.test_definedByGlobal  s(   € ð
 	�‰ð ô 	ð 	�‰ð õ 	r   c                 ó&   • U R                  S5        g)z%
"global" can accept multiple names.
zS
        def a(): global fu, bar; fu = 1; bar = 2
        def b(): fu; bar
        Nr   r   s    r   Ú!test_definedByGlobalMultipleNamesÚ&Test.test_definedByGlobalMultipleNames-  s   € ð 	�‰ð õ 	r   c                 óD   • U R                  S[        R                  5        g)z4
A global statement in the global scope is ignored.
zB
        global x
        def foo():
            print(x)
        Nr   r   s    r   Útest_globalInGlobalScopeÚTest.test_globalInGlobalScope6  s   € ð 	�‰ð ô �_‰_õ		r   c                 óD   • U R                  S[        R                  5        g)z@A global statement does not prevent other names being undefined.zQ
        def f1():
            s

        def f2():
            global m
        Nr   r   s    r   Útest_global_reset_name_onlyÚ Test.test_global_reset_name_only@  s   € ð 	�‰ð ô �_‰_õ	r   Útodoc                 óD   • U R                  S[        R                  5        g)z4An unused global statement does not define the name.zQ
        def f1():
            m

        def f2():
            global m
        Nr   r   s    r   Útest_unused_globalÚTest.test_unused_globalL  s   € ð 	�‰ð ô �_‰_õ	r   c                 óD   • U R                  S[        R                  5        g)zDel deletes bindings.za = 1; del a; aNr   r   s    r   Útest_delÚTest.test_delW  s   € à�‰Ð%¤q§¡Õ7r   c                 ó&   • U R                  S5        g)z%Del a global binding from a function.zY
        a = 1
        def f():
            global a
            del a
        a
        Nr   r   s    r   Útest_delGlobalÚTest.test_delGlobal[  s   € à�‰ð õ 	r   c                 óD   • U R                  S[        R                  5        g)zDel an undefined name.zdel aNr   r   s    r   Útest_delUndefinedÚTest.test_delUndefinede  s   € à�‰�GœQŸ_™_Õ-r   c                 ó&   • U R                  S5        g)z(
Ignores conditional bindings deletion.
zq
        context = None
        test = True
        if False:
            del(test)
        assert(test)
        Nr   r   s    r   Útest_delConditionalÚTest.test_delConditionali  s   € ð 	�‰ð õ 	r   c                 ó&   • U R                  S5        g)zP
Ignored conditional bindings deletion even if they are nested in other
blocks.
z‘
        context = None
        test = True
        if False:
            with context():
                del(test)
        assert(test)
        Nr   r   s    r   Útest_delConditionalNestedÚTest.test_delConditionalNestedu  s   € ð
 	�‰ð õ 	r   c                 ó&   • U R                  S5        g)zJ
Ignore bindings deletion if called inside the body of a while
statement.
z~
        def test():
            foo = 'bar'
            while False:
                del foo
            assert(foo)
        Nr   r   s    r   Útest_delWhileÚTest.test_delWhileƒ  r%   r   c                 ó&   • U R                  S5        g)zt
Ignore bindings deletion if called inside the body of a while
statement and name is used inside while's test part.
z†
        def _worker():
            o = True
            while o is not True:
                del o
                o = False
        Nr   r   s    r   Útest_delWhileTestUsageÚTest.test_delWhileTestUsage�  r%   r   c                 ó&   • U R                  S5        g)z`
Ignore bindings deletions if node is part of while's test, even when
del is in a nested block.
zå
        context = None
        def _worker():
            o = True
            while o is not True:
                while True:
                    with context():
                        del o
                o = False
        Nr   r   s    r   Útest_delWhileNestedÚTest.test_delWhileNested�  s   € ð
 	�‰ð 	õ 		r   c                 ó&   • U R                  S5        g)z.Global names are available from nested scopes.zO
        a = 1
        def b():
            def c():
                a
        Nr   r   s    r   Útest_globalFromNestedScopeÚTest.test_globalFromNestedScope­  r4   r   c                 óD   • U R                  S[        R                  5        g)zf
Test that referencing a local name that shadows a global, before it is
defined, generates a warning.
z_
        a = 1
        def fun():
            a
            a = 2
            return a
        Nr9   r   s    r   Ú(test_laterRedefinedGlobalFromNestedScopeÚ-Test.test_laterRedefinedGlobalFromNestedScope¶  s    € ð
 	�‰ð ô ×Ñõ	r   c                 óD   • U R                  S[        R                  5        g)z—
Test that referencing a local name in a nested scope that shadows a
global declared in an enclosing scope, before it is defined, generates
a warning.
z´
            a = 1
            def fun():
                global a
                def fun2():
                    a
                    a = 2
                    return a
        Nr9   r   s    r   Ú)test_laterRedefinedGlobalFromNestedScope2Ú.Test.test_laterRedefinedGlobalFromNestedScope2Ã  s    € ð 	�‰ð ô ×Ñõ	r   c                 óD   • U R                  S[        R                  5        g)zï
If a name defined in an enclosing scope is shadowed by a local variable
and the name is used locally before it is bound, an unbound local
warning is emitted, even if there is a class scope between the enclosing
scope and the local scope.
zÊ
        def f():
            x = 1
            class g:
                def h(self):
                    a = x
                    x = None
                    print(x, a)
            print(x)
        Nr9   r   s    r   Ú"test_intermediateClassScopeIgnoredÚ'Test.test_intermediateClassScopeIgnoredÓ  s    € ð 	�‰ð 	ô ×Ñõ		r   c                 óÄ   • U R                  S[        R                  5      R                  S   nU R                  (       a  SOSnU R                  UR                  SU45        g)zî
Test that referencing a local name in a nested scope that shadows a
variable declared in two different outer scopes before it is defined
in the innermost scope generates an UnboundLocal warning which
refers to the nearest shadowed name.
a  
            def a():
                x = 1
                def b():
                    x = 2 # line 5
                    def c():
                        x
                        x = 3
                        return x
                    return x
                return x
        r   r	   é   ÚxN)r   r   r:   r   ÚwithDoctestÚassertEqualÚmessage_args)r   ÚexcÚexpected_line_nums      r   Ú$test_doubleNestingReportsClosestNameÚ)Test.test_doubleNestingReportsClosestNameå  s^   € ð �k‰kð ô ×Ñó÷  (™x¨ñ+ˆð "&×!1×!1™A°qÐà×Ñ˜×)Ñ)¨CÐ1BÐ+CÕDr   c                 óD   • U R                  S[        R                  5        g)zx
Test that referencing a local name in a nested scope that shadows a
global, before it is defined, generates a warning.
z¸
            def fun():
                a = 1
                def fun2():
                    a
                    a = 1
                    return a
                return a
        Nr9   r   s    r   Ú)test_laterRedefinedGlobalFromNestedScope3Ú.Test.test_laterRedefinedGlobalFromNestedScope3þ  r0   r   c                 ó¼   • U R                  S[        R                  [        R                  [        R                  [        R                  [        R                  5        g )NzÖ
            def f(seq):
                a = 0
                seq[a] += 1
                seq[b] /= 2
                c[0] *= 2
                a -= 3
                d += 4
                e[any] = 5
            r   r   s    r   Ú!test_undefinedAugmentedAssignmentÚ&Test.test_undefinedAugmentedAssignment  s9   € Ø�‰ð	ô �O‰OÜ�O‰OÜ�O‰OœQ×-Ñ-Ü�O‰Oõ	
r   c                 ó&   • U R                  S5        g)z*Nested classes can access enclosing scope.z³
        def f(foo):
            class C:
                bar = foo
                def f(self):
                    return foo
            return C()

        f(123).f()
        Nr   r   s    r   Útest_nestedClassÚTest.test_nestedClass  s   € à�‰ð 	õ 		r   c                 óD   • U R                  S[        R                  5        g)z=Free variables in nested classes must bind at class creation.z‚
        def f():
            class C:
                bar = foo
            foo = 456
            return foo
        f()
        Nr   r   s    r   Útest_badNestedClassÚTest.test_badNestedClass,  s   € à�‰ð ô �_‰_õ	r   c                 ó&   • U R                  S5        g)z+Star and double-star arg names are defined.z?
        def f(a, *b, **c):
            print(a, b, c)
        Nr   r   s    r   Útest_definedAsStarArgsÚTest.test_definedAsStarArgs7  s   € à�‰ð õ 	r   c                 ój   • U R                  S5        U R                  S5        U R                  S5        g)z!Star names in unpack are defined.z7
        a, *b = range(10)
        print(a, b)
        z7
        *a, b = range(10)
        print(a, b)
        z=
        a, *b, c = range(10)
        print(a, b, c)
        Nr   r   s    r   Útest_definedAsStarUnpackÚTest.test_definedAsStarUnpack>  s9   € à�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð õ 	r   c                 ój   • U R                  S5        U R                  S5        U R                  S5        g)zC
Star names in unpack are used if RHS is not a tuple/list literal.
z8
        def f():
            a, *b = range(10)
        z:
        def f():
            (*a, b) = range(10)
        z=
        def f():
            [a, *b, c] = range(10)
        Nr   r   s    r   Útest_usedAsStarUnpackÚTest.test_usedAsStarUnpackM  s;   € ð 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð õ 	r   c                 ó<  • U R                  S[        R                  [        R                  5        U R                  S[        R                  [        R                  5        U R                  S[        R                  [        R                  [        R                  5        g)zA
Star names in unpack are unused if RHS is a tuple/list literal.
zC
        def f():
            a, *b = any, all, 4, 2, 'un'
        zL
        def f():
            (*a, b) = [bool, int, float, complex]
        zD
        def f():
            [a, *b, c] = 9, 8, 7, 6, 5, 4
        Nr-   r   s    r   Útest_unusedAsStarUnpackÚTest.test_unusedAsStarUnpack^  s}   € ð 	�‰ð ô ×Ñœq×/Ñ/ô	1ð 	�‰ð ô ×Ñœq×/Ñ/ô	1ð 	�‰ð ô ×Ñœq×/Ñ/´×1AÑ1Aõ	Cr   c                 óH   • U R                  S5        U R                  S5        g)z#Keyword-only arg names are defined.z>
        def f(*, a, b=None):
            print(a, b)
        z\
        import default_b
        def f(*, a, b=default_b):
            print(a, b)
        Nr   r   s    r   Útest_keywordOnlyArgsÚTest.test_keywordOnlyArgso  s&   € à�‰ð ô 	ð
 	�‰ð õ 	r   c                 óD   • U R                  S[        R                  5        g)zTypo in kwonly name.zC
        def f(*, a, b=default_c):
            print(a, b)
        Nr   r   s    r   Útest_keywordOnlyArgsUndefinedÚ"Test.test_keywordOnlyArgsUndefined|  s   € à�‰ð ô �_‰_õ	r   c                 óH   • U R                  S5        U R                  S5        g)zUndefined annotations.z¦
        from abc import note1, note2, note3, note4, note5
        def func(a: note1, *args: note2,
                 b: note3=12, **kw: note4) -> note5: pass
        zk
        def func():
            d = e = 42
            def func(a: {1, d}) -> (lambda c: e): pass
        Nr   r   s    r   Útest_annotationUndefinedÚTest.test_annotationUndefinedƒ  s&   € à�‰ð ô 	ð 	�‰ð õ 	r   c                 ó&   • U R                  S5        g )NzR
        from abc import ABCMeta
        class A(metaclass=ABCMeta): pass
        r   r   s    r   Útest_metaClassUndefinedÚTest.test_metaClassUndefined‘  s   € Ø�‰ð õ 	r   c                 óH   • U R                  S5        U R                  S5        g)zK
Using the loop variable of a generator expression results in no
warnings.
z(a for a in [1, 2, 3] if a)z-(b for b in (a for a in [1, 2, 3] if a) if b)Nr   r   s    r   Útest_definedInGenExpÚTest.test_definedInGenExp—  s   € ð
 	�‰Ð1Ô2à�‰ÐCÕDr   c                 ó„   • U R                  S[        R                  5        U R                  S[        R                  5        g)ze
The loop variables of generator expressions nested together are
not defined in the other generator.
z-(b for b in (a for a in [1, 2, 3] if b) if b)z-(b for b in (a for a in [1, 2, 3] if a) if a)Nr   r   s    r   Útest_undefinedInGenExpNestedÚ!Test.test_undefinedInGenExpNested   s2   € ð
 	�‰ÐCÜ—O‘Oô	%ð 	�‰ÐCÜ—O‘Oõ	%r   c                 óÈ   • U R                  S5        U R                  S5        U R                  S[        R                  5        U R                  S[        R                  5        g)zZ
Some compatibility code checks explicitly for NameError.
It should not trigger warnings.
zc
        try:
            socket_map
        except NameError:
            socket_map = {}
        z¡
        try:
            _memoryview.contiguous
        except (NameError, AttributeError):
            raise RuntimeError("Python >= 3.3 is required")
        zY
        try:
            socket_map
        except:
            socket_map = {}
        zc
        try:
            socket_map
        except Exception:
            socket_map = {}
        Nr   r   s    r   Útest_undefinedWithErrorHandlerÚ#Test.test_undefinedWithErrorHandler«  s`   € ð
 	�‰ð ô 	ð 	�‰ð ô 	ð 	�‰ð ô
 �_‰_ô	ð 	�‰ð ô
 �_‰_õ	r   c                 óH   • U R                  S5        U R                  S5        g)zD
Defined name for generator expressions and dict/set comprehension.
z 
        class A:
            T = range(10)

            Z = (x for x in T)
            L = [x for x in T]
            B = dict((i, str(i)) for i in T)
        zu
        class A:
            T = range(10)

            X = {x for x in T}
            Y = {x:x for x in T}
        Nr   r   s    r   Útest_definedInClassÚTest.test_definedInClassÊ  s(   € ð 	�‰ð ô 	ð 	�‰ð õ 	r   c                 ó&   • U R                  S5        g)z9Defined name for nested generator expressions in a class.za
        class A:
            T = range(10)

            Z = (x for x in (a for a in T))
        Nr   r   s    r   Útest_definedInClassNestedÚTest.test_definedInClassNestedß  r4   r   c                 óÄ   • U R                  S[        R                  5        U R                  S[        R                  5        U R                  S[        R                  5        g)z@
The loop variable is defined after the expression is computed.
z9
        for i in range(i):
            print(i)
        z(
        [42 for i in range(i)]
        z(
        (42 for i in range(i))
        Nr   r   s    r   Útest_undefinedInLoopÚTest.test_undefinedInLoopè  sR   € ð 	�‰ð ô �_‰_ô	ð 	�‰ð ä�_‰_ô	ð 	�‰ð ä�_‰_õ	r   c                 ó&   • U R                  S5        g)zQ
Defined name referenced from a lambda function within a dict/set
comprehension.
z4
        {lambda: id(x) for x in range(10)}
        Nr   r   s    r   Ú/test_definedFromLambdaInDictionaryComprehensionÚ4Test.test_definedFromLambdaInDictionaryComprehension÷  ó   € ð
 	�‰ð õ 	r   c                 ó&   • U R                  S5        g)zO
Defined name referenced from a lambda function within a generator
expression.
z7
        any(lambda: id(x) for x in range(10))
        Nr   r   s    r   Ú!test_definedFromLambdaInGeneratorÚ&Test.test_definedFromLambdaInGenerator   rë   r   c                 óD   • U R                  S[        R                  5        g)zS
Undefined name referenced from a lambda function within a dict/set
comprehension.
z4
        {lambda: id(y) for x in range(10)}
        Nr   r   s    r   Ú1test_undefinedFromLambdaInDictionaryComprehensionÚ6Test.test_undefinedFromLambdaInDictionaryComprehension	  ó   € ð
 	�‰ð ä�_‰_õ	r   c                 óD   • U R                  S[        R                  5        g)zQ
Undefined name referenced from a lambda function within a generator
expression.
z7
        any(lambda: id(y) for x in range(10))
        Nr   r   s    r   Ú'test_undefinedFromLambdaInComprehensionÚ,Test.test_undefinedFromLambdaInComprehension  rò   r   c                 ó*   • SnU R                  U5        g )Nzž
        class Test(object):
            def __init__(self):
                print(__class__.__name__)
                self.x = 1

        t = Test()
        r   )r   Úcodes     r   Útest_dunderClassÚTest.test_dunderClass  s   € ðˆð 	�‰�DÕr   © N)Hr_   rh   rl   Ú__firstlineno__r   r   r   r    r#   r   r'   r*   r.   r2   r6   r;   r>   rA   rD   rG   rJ   rN   rS   rW   r\   r`   re   ri   rm   rr   ru   rx   r{   r~   r‚   r…   rˆ   r‹   rŽ   r‘   r”   r—   rš   r�   r    r£   r¦   r°   r³   r¶   r¹   r¼   r¿   rÂ   rÅ   rÈ   rË   rÎ   rÑ   rÔ   r×   rÚ   rÝ   rà   rã   ræ   ré   rí   rð   rô   rø   Ú__static_attributes__rú   r   r   r   r      s¥  † ò,ò3ò%ò
0òñ 
Ð
AÓBñ%ó Cð%ò 0òòòñ$ 
Ð
AÓBñ&ó Cð&ñ" 
Ð
AÓBñ&ó Cð&ò(ò"ò(ò!ò$ò'ò ò$ò ò@òò ò 9ò
òòò
ñ 
ˆ&ƒ\ñó ðò8òò.ò
òòòòò òòò ò$Eò2ò
ò$ò	òòòò"Cò"òòòòEò	%òò>ò*òòòòòõ	r   r   c                   ó   • \ rS rSrSrS rSrg)Ú	NameTestsi'  z.
Tests for some extra cases of name handling.
c                 óÌ   • [         R                  " S5      n[        5       UR                  S   R                  S   l        U R                  [        [        R                  U5        g)zR
A Name node with an unrecognized context results in a RuntimeError being
raised.
zx = 10r   N)
ÚastÚparseÚobjectÚbodyÚtargetsÚctxÚassertRaisesÚRuntimeErrorr   ÚChecker)r   Útrees     r   Útest_impossibleContextÚ NameTests.test_impossibleContext+  sE   € ô
 �yŠy˜Ó"ˆä&,£hˆ�	‰	�!‰×Ñ˜QÑÔ#Ø×Ñœ,¬¯©¸Õ>r   rú   N)r_   rh   rl   rû   Ú__doc__r
  rü   rú   r   r   rþ   rþ   '  s   † ñõ?r   rþ   )
r   Úpyflakesr   r   r   Úpyflakes.test.harnessr   r   r   rþ   rú   r   r   Ú<module>r     s)   ðÛ 
ç +ß 0ô]ˆ8ô ]ô@?�õ ?r   