[pygobject/py3k] Fixed long value conversion
- From: John Ehresman <jpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject/py3k] Fixed long value conversion
- Date: Fri, 16 Apr 2010 17:58:04 +0000 (UTC)
commit 846e833166b5aacfed9f96ac985a5e005d5b81a9
Author: John Ehresman <jpe wingware com>
Date: Fri Apr 16 13:26:19 2010 -0400
Fixed long value conversion
gobject/pygtype.c | 14 +-------------
1 files changed, 1 insertions(+), 13 deletions(-)
---
diff --git a/gobject/pygtype.c b/gobject/pygtype.c
index 71769de..7734c3b 100644
--- a/gobject/pygtype.c
+++ b/gobject/pygtype.c
@@ -785,19 +785,7 @@ pyg_value_from_pyobject(GValue *value, PyObject *obj)
g_value_set_long(value, _PyLong_AsLong(obj));
break;
case G_TYPE_ULONG:
- {
- if (_PyLong_Check(obj)) {
- glong val;
-
- val = _PyLong_AsLong(obj);
- if (val >= 0)
- g_value_set_ulong(value, (gulong)val);
- else
- return -1;
- } else {
- g_value_set_ulong(value, PyLong_AsUnsignedLong(obj));
- }
- }
+ g_value_set_ulong(value, PyLong_AsUnsignedLong(obj));
break;
case G_TYPE_INT64:
g_value_set_int64(value, PyLong_AsLongLong(obj));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]