package exceptions
import (
	πg "grumpy"
	π_reflect "reflect"
)
func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseException) {
	ßExceptionTypes := πg.InternStr("ExceptionTypes")
	ß__name__ := πg.InternStr("__name__")
	ßg := πg.InternStr("g")
	ßglobals := πg.InternStr("globals")
	ßt := πg.InternStr("t")
	var πTemp001 *πg.Object
	_ = πTemp001
	var πTemp002 map[string]*πg.Object
	_ = πTemp002
	var πTemp003 *πg.Object
	_ = πTemp003
	var πTemp004 *πg.Object
	_ = πTemp004
	var πTemp005 *πg.Object
	_ = πTemp005
	var πTemp006 *πg.Object
	_ = πTemp006
	var πTemp007 *πg.Object
	_ = πTemp007
	var πTemp008 *πg.Object
	_ = πTemp008
	var πTemp009 *πg.Object
	_ = πTemp009
	var πTemp010 *πg.Object
	_ = πTemp010
	var πE *πg.BaseException; _ = πE
	for ; πF.State() >= 0; πF.PopCheckpoint() {
		switch πF.State() {
		case 0:
		default: panic("unexpected function state")
		}
		// line 15: """Built-in exception classes."""
		πF.SetLineno(15)
		// line 17: from __go__.grumpy import ExceptionTypes
		πF.SetLineno(17)
		πTemp002 = map[string]*πg.Object{}
		if πTemp003, πE = πg.WrapNative(πF, π_reflect.ValueOf(πg.ExceptionTypes)); πE != nil {
			continue
		}
		πTemp002["ExceptionTypes"] = πTemp003
		if πTemp001, πE = πg.ImportNativeModule(πF, "__go__.grumpy", πTemp002); πE != nil {
			continue
		}
		if πTemp003, πE = πg.GetAttr(πF, πTemp001, ßExceptionTypes, nil); πE != nil {
			continue
		}
		if πE = πF.Globals().SetItem(πF, ßExceptionTypes.ToObject(), πTemp003); πE != nil {
			continue
		}
		// line 20: g = globals()
		πF.SetLineno(20)
		if πTemp001, πE = πg.ResolveGlobal(πF, ßglobals); πE != nil {
			continue
		}
		if πTemp003, πE = πTemp001.Call(πF, nil, nil); πE != nil {
			continue
		}
		if πE = πF.Globals().SetItem(πF, ßg.ToObject(), πTemp003); πE != nil {
			continue
		}
		// line 21: for t in ExceptionTypes:
		πF.SetLineno(21)
		if πTemp001, πE = πg.ResolveGlobal(πF, ßExceptionTypes); πE != nil {
			continue
		}
		if πTemp003, πE = πg.Iter(πF, πTemp001); πE != nil {
			continue
		}
	Label1:
		if πTemp004, πE = πg.Next(πF, πTemp003); πE != nil {
			isStop, exc := πg.IsInstance(πF, πE.ToObject(), πg.StopIterationType.ToObject())
			if exc != nil {
				πE = exc
				continue
			}
			if !isStop {
				continue
			}
			πE = nil
			πF.RestoreExc(nil, nil)
			goto Label2
		}
		if πE = πF.Globals().SetItem(πF, ßt.ToObject(), πTemp004); πE != nil {
			continue
		}
		// line 22: g[t.__name__] = t
		πF.SetLineno(22)
		if πTemp005, πE = πg.ResolveGlobal(πF, ßt); πE != nil {
			continue
		}
		if πE = πg.Tie(πF, πg.TieTarget{Target: &πTemp006}, πTemp005); πE != nil {
			continue
		}
		if πTemp007, πE = πg.ResolveGlobal(πF, ßg); πE != nil {
			continue
		}
		if πTemp009, πE = πg.ResolveGlobal(πF, ßt); πE != nil {
			continue
		}
		if πTemp010, πE = πg.GetAttr(πF, πTemp009, ß__name__, nil); πE != nil {
			continue
		}
		πTemp008 = πTemp010
		if πE = πg.SetItem(πF, πTemp007, πTemp008, πTemp006); πE != nil {
			continue
		}
		goto Label1
		goto Label2
	Label2:
		return nil, nil
	}
	return nil, πE
}
var Code *πg.Code
func init() {
	Code = πg.NewCode("<module>", "lib/exceptions.py", nil, 0, initModule)
}
