[pygobject] Remove incorrect bounds check with property helper flags
- From: Simon Feltman <sfeltman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Remove incorrect bounds check with property helper flags
- Date: Fri, 15 Mar 2013 11:50:49 +0000 (UTC)
commit 471204953d6fc93b3d311afd133d40f7d75ec541
Author: Simon Feltman <sfeltman src gnome org>
Date: Fri Mar 15 04:33:22 2013 -0700
Remove incorrect bounds check with property helper flags
Remove bounds check for flags as it is not necessary for the
helper to make these kind of judgement calls in general.
e.g. leave it to marshaling/internals to complain about potential
problems. The flags were being bounds checked to a maximum
value of 32 (the intention was most likely to limit it to 32 bits).
gi/_gobject/propertyhelper.py | 3 ---
tests/test_properties.py | 1 -
2 files changed, 0 insertions(+), 4 deletions(-)
---
diff --git a/gi/_gobject/propertyhelper.py b/gi/_gobject/propertyhelper.py
index d5a1852..e8ccb35 100644
--- a/gi/_gobject/propertyhelper.py
+++ b/gi/_gobject/propertyhelper.py
@@ -168,9 +168,6 @@ class Property(object):
# we don't want the lengthy Property class documentation showing up
# on instances.
self.__doc__ = blurb
-
- if flags < 0 or flags > 32:
- raise TypeError("invalid flag value: %r" % (flags,))
self.flags = flags
# Call after setting blurb for potential __doc__ usage.
diff --git a/tests/test_properties.py b/tests/test_properties.py
index d0552e0..4b128f3 100644
--- a/tests/test_properties.py
+++ b/tests/test_properties.py
@@ -589,7 +589,6 @@ class TestProperty(unittest.TestCase):
self.assertRaises(TypeError, GObject.Property, type=bool)
self.assertRaises(TypeError, GObject.Property, type=object, default=0)
self.assertRaises(TypeError, GObject.Property, type=complex)
- self.assertRaises(TypeError, GObject.Property, flags=-10)
def test_defaults(self):
GObject.Property(type=bool, default=True)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]