summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-08-29 18:34:47 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-08-29 18:36:17 +0100
commit9ef22fa921f440560eb953177d83fae130bbaac4 (patch)
treea6565109c382e1d16afa6bba8d52c6bdbab9bfaa
parentb2378a81bb7acb94409469e8b19d0c717811a99d (diff)
downloadlibguestfs-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.ml2
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";