Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: TypeError produced not immediately, but with a next func call #29

Open
GoogleCodeExporter opened this issue May 13, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

I have module with e.g. such func

function xy_pos(Self, Args: PPyObject): PPyObject; cdecl;
var
  X, Y, N: Integer;
begin
  with GetPythonEngine do
  begin
    if PyArg_ParseTuple(Args, 'ii:xy_pos', @X, @Y) <> 0 then
    begin
      N:= X + Y;
      Result:= PyInt_FromLong(N);
    end;
  end;
end;

now i call it from my "console": I enter line into edit, and call 
"PythonEngine.ExecString(Str)".
i call: "print(xy_pos('test'))"

expected: TypeError after this call.

seen: this call does NOT give error, but next same call gives TypeError.
I see TypeError each two calls, but now after each signle call.

Delphi7 IDE doesn't give exception TypeError.

Original issue reported on code.google.com by [email protected] on 19 Dec 2013 at 3:33

@GoogleCodeExporter
Copy link
Author

example log:

Delphi 7
Python 3.2.5 (default, May 15 2013, 23:06:03) [MSC v.1500 32 bit (Intel)]
>>> xy_pos(1)
>>> xy_pos(1)
TypeError: xy_pos() takes exactly 2 arguments (1 given)
>>> xy_pos('test')
>>> xy_pos('test')
TypeError: xy_pos() takes exactly 2 arguments (1 given)
>>> xy_pos('test', 3, 4)
>>> xy_pos('test', 3, 4)
TypeError: xy_pos() takes exactly 2 arguments (3 given)

Original comment by [email protected] on 19 Dec 2013 at 3:36

@GoogleCodeExporter
Copy link
Author

If i call command with "print(xy_pos(.....))" then TypeError exists each call. 
If i call command w/o print: "r = xy_pos(.....)", then issue here.


Original comment by [email protected] on 19 Dec 2013 at 3:58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant