Skip to content

Commit

Permalink
Fix populate_scope() on int
Browse files Browse the repository at this point in the history
  • Loading branch information
aothms committed Dec 11, 2023
1 parent e532557 commit fd49c8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wrap/wrapper.i
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ void populate_scope(scope_map& scope, const argument_spec& spec, PyObject* obj)
if (PyFloat_Check(obj) && type_opts.find("real") != type_opts.end()) {
auto value = PyFloat_AsDouble(obj);
scope[spec.name] = value;
} else if (PyLong_Check(obj) && type_opts.find("real") != type_opts.end()) {
auto value = PyLong_AsLong(obj);
} else if (PyLong_Check(obj) && type_opts.find("integer") != type_opts.end()) {
int value = (int) PyLong_AsLong(obj);
scope[spec.name] = value;
} else if (PyUnicode_Check(obj) && type_opts.find("string") != type_opts.end()) {
auto value = std::string(PyUnicode_AsUTF8(obj));
Expand Down

0 comments on commit fd49c8c

Please sign in to comment.