Commit cf0d0f9d authored by Henry Schreiner's avatar Henry Schreiner Committed by Jason Rhinelander
Browse files

Matching Python 2 int behavior on Python 2 (#1186)

Pybind11's default conversion to int always produces a long on Python 2 (`int`s and `long`s were unified in Python 3). This patch fixes `int` handling to match Python 2 on Python 2; for short types (`size_t` or smaller), the number will be returned as an `int` if possible, otherwise `long`. Requires Python 2.5+.

This is needed for things like `sys.exit`, which refuse to accept a `long`.
parent 3b265787
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment