MCPcopy Index your code
hub / github.com/go-python/gopy / hasError

Function hasError

bind/utils.go:57–82  ·  view source on GitHub ↗
(sig *types.Signature)

Source from the content-addressed store, hash-verified

55}
56
57func hasError(sig *types.Signature) bool {
58 res := sig.Results()
59 if res == nil || res.Len() <= 0 {
60 return false
61 }
62
63 nerr := 0
64 for i := 0; i < res.Len(); i++ {
65 ret := res.At(i)
66 if isErrorType(ret.Type()) {
67 nerr++
68 }
69 }
70
71 switch {
72 case nerr == 0:
73 return false
74 case nerr == 1:
75 return true
76 default:
77 panic(fmt.Errorf(
78 "gopy: invalid number of comma-errors (%d)",
79 nerr,
80 ))
81 }
82}
83
84func isConstructor(sig *types.Signature) bool {
85 //TODO(sbinet)

Callers

nothing calls this directly

Calls 3

isErrorTypeFunction · 0.85
ResultsMethod · 0.80
AtMethod · 0.45

Tested by

no test coverage detected