{G_Tc@spdZddlmZmZddlZddlZdejfdYZdZe dkrlendS(sDVerify that warnings are issued for global statements following use.i(t run_unittesttcheck_syntax_errorNt GlobalTestscBs,eZdZdZdZdZRS(cCsd}t||dS(Ns<def wrong1(): a = 1 b = 2 global a global b (R(tselft prog_text_1((s,/usr/local/lib/python2.7/test/test_global.pyttest1 scCsd}t||dS(Ns'def wrong2(): print x global x (R(Rt prog_text_2((s,/usr/local/lib/python2.7/test/test_global.pyttest2scCsd}t||dS(Ns1def wrong3(): print x x = 2 global x (R(Rt prog_text_3((s,/usr/local/lib/python2.7/test/test_global.pyttest3scCsd}t|dddS(Nsglobal x x = 2 s texec(tcompile(Rt prog_text_4((s,/usr/local/lib/python2.7/test/test_global.pyttest4%s(t__name__t __module__RRR R (((s,/usr/local/lib/python2.7/test/test_global.pyRs  cCs4tj"tjdddttWdQXdS(Nterrortmodules (twarningstcatch_warningstfilterwarningsRR(((s,/usr/local/lib/python2.7/test/test_global.pyt test_main.s t__main__( t__doc__ttest.test_supportRRtunittestRtTestCaseRRR(((s,/usr/local/lib/python2.7/test/test_global.pyts  &