Current File : //opt/imh-python/lib/python2.7/test/test_scope.pyo
�
��Wc@sjddlZddlmZmZmZmZdejfd��YZd�Ze	dkrfe�ndS(i����N(tcheck_syntax_errortcheck_py3k_warningstcheck_warningstrun_unittestt
ScopeTestscBseZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cCsQd�}|d�}|d�}|j|d�d�|j|d�d�dS(Ncs�fd�}|S(Ncs�|S(N((ty(tx(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytadders((RR((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyt
make_adder
sii
ii����i(tassertEqual(tselfRtinctplus10((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestSimpleNestings
	cCsQd�}|d�}|d�}|j|d�d�|j|d�d�dS(Ncs�fd�}|�S(Ncs�fd�}|S(Ncs�|S(N((R(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyRs((R(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytextras((RR((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytmake_adder2sii
ii����i(R	(R
RRR((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestExtraNestings
	cCsQd�}|d�}|d�}|j|d�d�|j|d�d�dS(Ncs�fd�}�d�|S(Ncs�|S(N((R(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR'si((RR((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytmake_adder3&s
ii	iii����i(R	(R
RRR((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestSimpleAndRebinding$s
	csT�fd�}d�|�}|j|d�d�d�|j|d�d�dS(Ncs�fd�}|�S(Ncs�fd�}|�S(Ncs�fd�}|S(Ncs�|S(N((R(tglobal_x(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR7s((R(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytnest6s((R(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR5s((R(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytmake_adder44siii
i����i(R	(R
RR((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestNestingGlobalNoFree2s		cCsQd�}|d�}|d�}|j|d�d�|j|d�d�dS(Ncs dd�fd��Y}|�S(NtAddercseZ�fd�ZRS(cs�|S(N((R
R(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyt__call__Hs(t__name__t
__module__R((R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyRGs(((RR((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytmake_adder5Fsii
ii����i(R	(R
RRR((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestNestingThroughClassDs
	cCsQd�}|d�}|d�}|j|d�d�|j|d�d�dS(NcSsd�}|a|S(NcSst|S(N(t
global_nest_x(R((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyRVs(R(RR((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytmake_adder6Ts	ii
ii����i(R	(R
RRR((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestNestingPlusFreeRefToGlobalRs
	cCs/d�}|d�}|j|d�d�dS(NcSsd�}|d�S(Ncsd��fd�}|S(Ni*cs�|S(N((tz(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pythfs((RR!((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytgdsi((RR"((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytfcs	i
ii/(R	(R
R#t	test_func((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestNearestEnclosingScopeas	csSd���fd�}|ddd�}|ddd�}|j|�d�dS(	NcSs|S(N((R((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytidentitypscs���fd�}|S(Ncs0|�}����fd�}|��|S(Ncs�����S(N(((tbR&RR (sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR!vs((taR'tcR!(R&RR (R'Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR"ts

((RRR R"(R&(RR sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR#ssiiiiii'(R	(R
R#R"R!((R&sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestMixedFreevarsAndCellvarsns
	cs�d�}|�}|j|j�d�|j|j�d�|j|j�d�d�dd�fd��Y}|�}|j|j�d�|j|j�d�|j|j�d�dS(Ncs&d�dd�fd��Y}|�S(NtvartTestcs2eZd�Z�fd�Zd�Zd�ZRS(cSsdS(Ntmethod((R
((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytmethod_and_var�scs�S(N((R
(R.(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttest�scSs
td�S(Ntglobal(tstr(R
((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyt
actual_global�scSs
t|�S(N(R1(R
((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR1�s(RRR.R/R2R1((R.(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR,�s		(((R,((R.sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR/�s	R+R-R0R,cs2eZd�Z�fd�Zd�Zd�ZRS(cSsdS(NR-((R
((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR.�scs�S(N((R
(R.(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR/�scSs
td�S(NR0(R1(R
((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR2�scSs
t|�S(N(R1(R
((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR1�s(RRR.R/R2R1((R.(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR,�s		((R	R/R.R2(R
R/ttR,((R.sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestFreeVarInMethod�s	
		cCs#d�}|j|d�d�dS(Ncs2�fd��|dkr%�|�Std�dS(Ncs&|dkrdS|�|d�SdS(Nii((tn(tfact(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR6�sisx must be >= 0(t
ValueError(R((R6sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR#�s
ii�(R	(R
R#((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyt
testRecursion�s	cBsZe|d�e|d�e|d�e|d�e|d�e|d�ddUdS(Ns�def unoptimized_clash1(strip):
    def f(s):
        from string import *
        return strip(s) # ambiguity: free or local
    return f
s�def unoptimized_clash2():
    from string import *
    def f(s):
        return strip(s) # ambiguity: global or local
    return f
s�def unoptimized_clash2():
    from string import *
    def g():
        def f(s):
            return strip(s) # ambiguity: global or local
        return f
sOdef error(y):
    exec "a = 1"
    def f(x):
        return x + y
    return f
sCdef f(x):
    def g():
        return x
    del x # can't del name
s[def f():
    def g():
        from string import *
        return strip # global or local?
s�
def noproblem1():
    from string import *
    f = lambda x:x

def noproblem2():
    from string import *
    def f(x):
        return x + 1

def noproblem3():
    from string import *
    def f(x):
        global y
        y = x
(R(R
((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestUnoptimizedNamespaces�sc	sd�}|d�}|d�}|j|d�d�|j|d�d�d�}|d�}|d�}|j|d�d�|j|d�d��fd�}d�|d�}|j|d�d	�d
�}|ddd	�}|ddd�}|j|�d
�dS(Ncs
�fd�S(Ncs�|S(N((R(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyt<lambda>�s((R((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR:�sii
iiics�fd��S(Ncs
�fd�S(Ncs�|S(N((R(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR:s(((R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR:s((R((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR:scs
�fd�S(Ncs�|S(N((R(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR:
s((R(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR:
sics��fd�S(Ncs���fd�S(Ncs���S(N(((R'RR (sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR:s((R(R'R)(RR (R'sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR:s((RRR ((RR sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR:siii(R	tNone(	R
tf1RRtf2tf3tf8R"R!((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestLambdas�s$			cBsHd�}d�}|je|�|je|�di|jd6UdS(Ncs�GH�fd�}d�dS(Ncs�S(N(((R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytinnersi((RA((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyterrorInOuterscs �fd�}|�d�dS(Ncs�S(N(((R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyRAsi((RA((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyterrorInInnerss�
global_x = 1
def f():
    global_x += 1
try:
    f()
except UnboundLocalError:
    pass
else:
    fail('scope of global_x not correctly determined')
tfail(tassertRaisestUnboundLocalErrort	NameErrorRD(R
RBRC((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestUnboundLocals
		
cBs�d�}|j|ddd��d�d�}|j|dd��dd�edef��d	e�UWdQX|jed�d�d�dS(Ncs�fd�}|S(Ncs�S(N(((tlst(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytreturner5s((RIRJ((RIsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytmakeReturner4siiics�fd�}|S(Ncs�S(N(((tkwargs(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyRJ<s((RLRJ((RLsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyt
makeReturner2;sR(is*tuple parameter unpacking has been removedscdef makeAddPair((a, b)):
    def addPair((c, d)):
        return (a + c, b + d)
    return addPair
idi�iei�(iii(ii(idi�(iei�(R	Rt
SyntaxWarningtlocalstmakeAddPair(R
RKRM((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestComplexDefinitions2s		 
cBsddUdS(Ns�# I
x = 7
def f():
    x = 1
    def g():
        global x
        def i():
            def h():
                return x
            return h()
        return i()
    return g()
self.assertEqual(f(), 7)
self.assertEqual(x, 7)

# II
x = 7
def f():
    x = 1
    def g():
        x = 2
        def i():
            def h():
                return x
            return h()
        return i()
    return g()
self.assertEqual(f(), 2)
self.assertEqual(x, 7)

# III
x = 7
def f():
    x = 1
    def g():
        global x
        x = 2
        def i():
            def h():
                return x
            return h()
        return i()
    return g()
self.assertEqual(f(), 2)
self.assertEqual(x, 2)

# IV
x = 7
def f():
    x = 3
    def g():
        global x
        x = 2
        def i():
            def h():
                return x
            return h()
        return i()
    return g()
self.assertEqual(f(), 2)
self.assertEqual(x, 2)

# XXX what about global statements in class blocks?
# do they affect methods?

x = 12
class Global:
    global x
    x = 13
    def set(self, val):
        x = val
    def get(self):
        return x

g = Global()
self.assertEqual(g.get(), 13)
g.set(15)
self.assertEqual(g.get(), 13)
((R
((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestScopeOfGlobalStmtLsRcs]dd�fd��Y��fd�}xtd�D]
}|�q5W|j�jd�dS(NtFoocs,eZdZ�fd�Z�fd�ZRS(ics�jd7_dS(Ni(tcount(R
(RS(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyt__init__�scs�jd8_dS(Ni(RT(R
(RS(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyt__del__�s(RRRTRURV((RS(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyRS�scs#����fd�}|�dS(Ncs�S(N(((R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR=�s((R=(RS(Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR<�s	idi((trangeR	RT(R
R<ti((RSsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyt	testLeaks�s
	cBsddUdS(Ns�def test(x):
    class Foo:
        global x
        def __call__(self, y):
            return x + y
    return Foo()

x = 0
self.assertEqual(test(6)(2), 8)
x = -1
self.assertEqual(test(3)(2), 5)

looked_up_by_load_name = False
class X:
    # Implicit globals inside classes are be looked up by LOAD_NAME, not
    # LOAD_GLOBAL.
    locals()['looked_up_by_load_name'] = True
    passed = looked_up_by_load_name

self.assertTrue(X.passed)
((R
((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestClassAndGlobal�scCs[d�}|d�d�}|jd|�|d=|j|idd6dd6dd	6�dS(
Ncs�fd�}|S(Ncs*�fd�}��}�d7�t�S(Ncs�|S(N((R (R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR!�si(RO(RR!tw(R(Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR"�s

((RR"((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR#�siiR!RiRiR[(tassertInR	(R
R#td((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestLocalsFunction�s
		cCs^d�}|j|d�jd�d�}|d�j}|jd|�|jd|�dS(Ncsdd�fd��Y}|S(NtCcs$eZdZ�fd�Ze�RS(ics�S(N((R
(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytm�s(RRRR`RO((R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR_�s(((RR_((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR#�siicsdd�fd��Y}|S(NR_cs,eZ�Z�fd�Zee��ZRS(cs�S(N((R
(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR`�s(RRRR`tlistROR ((R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR_�s(((RR_((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR#�sRR(R	RR tassertNotInR\(R
R#tvarnames((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestLocalsClass�s		csdddl}|jd��z3d�dd�fd��Y}|j�d�Wd|jd�XdS(Ni����cSsdS(N(R;(R(R'R)((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR:siR_cseZ�fd�ZRS(cs�S(N((R
(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR#s(RRR#((R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR_
s((tsystsettraceR	R;(R
ReR_((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestLocalsClass_WithTracescCs5d�}|d��}|j|j|j��dS(Ncsdd�fd��Y}|S(NR_cseZ�fd�Z�ZRS(cs�S(N((R
(R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR`s(RRR`R(((R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR_s(((RR_((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR#si(R	R(R`(R
R#tinst((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestBoundAndFrees	csxddl}�fd��d�}dd	d��Y}|j��|d|d
�|jd�|jt|j�dS(Ni����cs�S(N((R(R'R)(ttracer(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyRj"scsK|\}�|dkrG�dkr:d|j|f�n�fd�SdS(Nits_%s__%scs
t|��S(N(tgetattr(tobj(tdes(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR:*s(R(tnametklasstgettertkind((Rnsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pytadaptgetter%s
t	TestClasscBseZRS((RR(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyRt,stfooiRk((iRk(ReRfR;REt	TypeError(R
ReRsRt((Rjsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestInteractionWithTraceFuncs	

cBs_d�}|d�}|jee|j�y|jiUWnek
rMnX|jd�dS(Ncs
�fd�S(Ncs�dS(Ni(((R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR:8s((R((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR#7sis9exec should have failed, because code contained free vars(RERvtevalt	func_codeRD(R
R#R"((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestEvalExecFreeVars5s	
cCsSy	tGHWntk
rnXdGHd�}|�y	tGHWntk
rNnXdS(Nsbad should not be definedcSs.gdD]}|j�D]}|^qqdS(Nsa b(tsplit(tstbad((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyRMs(R}RG(R
R((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestListCompLocalVarsDs	
		
cCsd�}|d��dS(Ncs�fd�}|S(Ncs�td�dS(Nsx + 1(Rx((R(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR"Ys((RR"((Rsh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR#Xsi((R
R#((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestEvalFreeVarsVs	cs-ddd��Y��fd�}|�dS(NtSpecialcBseZd�ZRS(cSst�dS(N(tnestedcell_get(R
((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyRVds(RRRV(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR�cscs%�fd�a��f�d�dS(Ncs�S(N(((R)(sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR�isi(R�((R�(R)sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR#gs(((R
R#((R�sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestFreeingCell`scBsHd}i}i}|||U|jd|d�|jd|d�dS(Ns�def f():
    y = 1
    def g():
        global y
        return y
    def h():
        return y + 1
    return g, h

y = 9
g, h = f()
result9 = g()
result2 = h()
itresult2i	tresult9(R	(R
tCODEtlocal_nst	global_ns((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyt#testGlobalInParallelNestedFunctionsqs
cCsd�}d�}dS(NcSsdS(N((R(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttop�scSsdS(N((((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyR'�s((R
R�R'((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyttestTopIsNotSignificant�s	(RRR
RRRRRR%R*R4R8R9R@RHRQRRRYRZR^RdRgRiRwRzR~RR�R�R�(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyRs8	
						
		%		E				T				!		
				
		cCs'tdtf��tt�WdQXdS(Ns&import \* only allowed at module level(RRNRR(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyt	test_main�s
t__main__(
tunittestttest.test_supportRRRRtTestCaseRR�R(((sh/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_scope.pyt<module>s"���