From 5a8ae4f6b1a69ad96c17d894972556296b7fe513 Mon Sep 17 00:00:00 2001 From: denfromufa Date: Thu, 26 May 2016 03:38:26 -0600 Subject: [PATCH] Update methodbinder.cs https://github.com/pythonnet/pythonnet/issues/203 @vmuriart @tonyroberts --- src/runtime/methodbinder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/methodbinder.cs b/src/runtime/methodbinder.cs index 22aaf33e4..f2ee104fc 100644 --- a/src/runtime/methodbinder.cs +++ b/src/runtime/methodbinder.cs @@ -344,7 +344,7 @@ internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, if (clrtype != null) { bool typematch = false; - if (pi[n].ParameterType != clrtype) + if ((pi[n].ParameterType != clrtype) && !(pi[n].ParameterType.IsAssignableFrom(clrtype))) { IntPtr pytype = Converter.GetPythonTypeByAlias(pi[n].ParameterType); pyoptype = Runtime.PyObject_Type(op); @@ -603,4 +603,4 @@ internal Binding(MethodBase info, Object inst, Object[] args, this.outs = outs; } } -} \ No newline at end of file +}