8000 Adds method name to "no method matches" error (#653) · pythonnet/pythonnet@611814c · GitHub
[go: up one dir, main page]

Skip to content

Commit 611814c

Browse files
AlexCatarinofilmor
authored andcommitted
Adds method name to "no method matches" error (#653)
1 parent 4968832 commit 611814c

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
## Contributors
1414

15+
- Alexandre Catarino([@AlexCatarino](https://github.com/AlexCatarino))
1516
- Arvid JB ([@ArvidJB](https://github.com/ArvidJB))
1617
- Bradley Friedman ([@leith-bartrich](https://github.com/leith-bartrich))
1718
- Callum Noble ([@callumnoble](https://github.com/callumnoble))

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
9292
- Fixed `Python.Runtime.dll.config` on macOS ([#120][i120])
9393
- Fixed crash on `PythonEngine.Version` ([#413][i413])
9494
- Fixed `PythonEngine.PythonPath` issues ([#179][i179])([#414][i414])([#415][p415])
95+
- Fixed missing information on 'No method matches given arguments' by adding the method name
9596

9697
### Removed
9798

src/runtime/methodbinder.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,12 @@ internal virtual IntPtr Invoke(IntPtr inst, IntPtr args, IntPtr kw, MethodBase i
507507

508508
if (binding == null)
509509
{
510-
Exceptions.SetError(Exceptions.TypeError, "No method matches given arguments");
510+
var value = "No method matches given arguments";
511+
if (methodinfo != null && methodinfo.Length > 0)
512+
{
513+
value += $" for {methodinfo[0].Name}";
514+
}
515+
Exceptions.SetError(Exceptions.TypeError, value);
511516
return IntPtr.Zero;
512517
}
513518

0 commit comments

Comments
 (0)
0