[Sugar-devel] [PATCH] fix two trivial shell.log warnings
James Cameron
quozl at laptop.org
Mon May 10 01:06:14 EDT 2010
"DeprecationWarning: integer argument expected, got float" was happening
in two places. An issue that has been with us for at least 12 months,
since it was also seen in logs attached to SL #870.
---
src/sugar/graphics/icon.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/sugar/graphics/icon.py b/src/sugar/graphics/icon.py
index 57c53f5..8e3861c 100644
--- a/src/sugar/graphics/icon.py
+++ b/src/sugar/graphics/icon.py
@@ -133,7 +133,7 @@ class _IconBuffer(object):
if self.width != None:
size = self.width
- info = theme.lookup_icon(self.icon_name, size, 0)
+ info = theme.lookup_icon(self.icon_name, int(size), 0)
if info:
attach_x, attach_y = self._get_attach_points(info, size)
@@ -178,8 +178,8 @@ class _IconBuffer(object):
def _get_size(self, icon_width, icon_height, padding):
if self.width is not None and self.height is not None:
- width = self.width + padding
- height = self.height + padding
+ width = int(self.width) + padding
+ height = int(self.height) + padding
else:
width = icon_width + padding
height = icon_height + padding
--
1.7.1
More information about the Sugar-devel
mailing list