Skip to content

Commit ced6726

Browse files
committed
Fix go vet warnings
1 parent 08eff15 commit ced6726

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎py/type.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,7 +1138,7 @@ func TypeNew(metatype *Type, args Tuple, kwargs StringDict) Object{
11381138
ifwinner!=metatype{
11391139
//if winner.New != TypeNew{// Pass it to the winner
11401140
// FIXME Nasty hack since you can't compare function pointers in Go
1141-
iffmt.Sprintf("%x", winner.New) !=fmt.Sprintf("%x", TypeNew){// Pass it to the winner
1141+
iffmt.Sprintf("%p", winner.New) !=fmt.Sprintf("%p", TypeNew){// Pass it to the winner
11421142
returnwinner.New(winner, args, kwargs)
11431143
}
11441144
metatype=winner
@@ -1504,7 +1504,7 @@ func excess_args(args Tuple, kwargs StringDict) bool{
15041504
funcObjectInit(selfObject, argsTuple, kwargsStringDict){
15051505
t:=self.Type()
15061506
// FIXME bodge to compare function pointers
1507-
ifexcess_args(args, kwargs) && (fmt.Sprintf("%x", t.New) ==fmt.Sprintf("%x", ObjectNew) ||fmt.Sprintf("%x", t.Init) !=fmt.Sprintf("%x", ObjectInit)){
1507+
ifexcess_args(args, kwargs) && (fmt.Sprintf("%p", t.New) ==fmt.Sprintf("%p", ObjectNew) ||fmt.Sprintf("%p", t.Init) !=fmt.Sprintf("%p", ObjectInit)){
15081508
panic(ExceptionNewf(TypeError, "object.__init__() takes no parameters"))
15091509
}
15101510
// Call the __init__ method if it exists
@@ -1524,7 +1524,7 @@ func ObjectInit(self Object, args Tuple, kwargs StringDict){
15241524

15251525
funcObjectNew(t*Type, argsTuple, kwargsStringDict) Object{
15261526
// FIXME bodge to compare function pointers
1527-
ifexcess_args(args, kwargs) && (fmt.Sprintf("%x", t.Init) ==fmt.Sprintf("%x", ObjectInit) ||fmt.Sprintf("%x", t.New) !=fmt.Sprintf("%x", ObjectNew)){
1527+
ifexcess_args(args, kwargs) && (fmt.Sprintf("%p", t.Init) ==fmt.Sprintf("%p", ObjectInit) ||fmt.Sprintf("%p", t.New) !=fmt.Sprintf("%p", ObjectNew)){
15281528
panic(ExceptionNewf(TypeError, "object() takes no parameters"))
15291529
}
15301530

0 commit comments

Comments
(0)