# HG changeset patch # User Paul Boddie # Date 1484949852 -3600 # Node ID 8cd93e843b254d0da4704ac522271fb55a71fbf6 # Parent e1298eab8a6fcb4488a2e9cbdb32208c20f510d9 Raise a TypeError when no callable is obtained within get_using. diff -r e1298eab8a6f -r 8cd93e843b25 templates/native/program.c --- a/templates/native/program.c Fri Jan 20 22:03:27 2017 +0100 +++ b/templates/native/program.c Fri Jan 20 23:04:12 2017 +0100 @@ -1,6 +1,6 @@ /* Native functions for program operations. -Copyright (C) 2016 Paul Boddie +Copyright (C) 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -30,8 +30,13 @@ { __attr * const callable = &__args[1]; __attr * const instance = &__args[2]; + __attr out; - return __replace_context(instance->value, *callable); + out = __replace_context(instance->value, *callable); + if (out.value == 0) + __raise_type_error(); + + return out; } /* Module initialisation. */