diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-08-29 18:34:47 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-08-29 18:36:17 +0100 |
commit | 9ef22fa921f440560eb953177d83fae130bbaac4 (patch) | |
tree | a6565109c382e1d16afa6bba8d52c6bdbab9bfaa | |
parent | b2378a81bb7acb94409469e8b19d0c717811a99d (diff) | |
download | libguestfs-9ef22fa921f440560eb953177d83fae130bbaac4.tar.gz libguestfs-9ef22fa921f440560eb953177d83fae130bbaac4.tar.xz libguestfs-9ef22fa921f440560eb953177d83fae130bbaac4.zip |
python: Convert OInt64 using PyLong_AsLongLong so 64 bit ints work correctly.
This avoids the following error on 32 bit machines:
OverflowError: Python int too large to convert to C long
-rw-r--r-- | generator/generator_python.ml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/generator/generator_python.ml b/generator/generator_python.ml index b11df6ee..c1a0c30d 100644 --- a/generator/generator_python.ml +++ b/generator/generator_python.ml @@ -384,7 +384,7 @@ free_strings (char **argv) pr " optargs_s.%s = PyInt_AsLong (py_%s);\n" n n; pr " if (PyErr_Occurred ()) return NULL;\n" | OInt64 _ -> - pr " optargs_s.%s = PyLong_AsLong (py_%s);\n" n n; + pr " optargs_s.%s = PyLong_AsLongLong (py_%s);\n" n n; pr " if (PyErr_Occurred ()) return NULL;\n" | OString _ -> pr "#ifdef HAVE_PYSTRING_ASSTRING\n"; |