# test the __globals__ attribute of a functiondeffoo():passifnothasattr(foo,"__globals__"):print("SKIP")raiseSystemExitprint(type(foo.__globals__))print(foo.__globals__isglobals())foo.__globals__["bar"]=123print(bar)try:foo.__globals__=NoneexceptAttributeError:print("AttributeError")