mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-29 23:32:33 +00:00
Allow Bitmask to be created from ints and longs but always store as long
We need a 64 bit integer, and previously the test failed because it was already created from longs in various cases (e.g. when reading from a GstStructure).
This commit is contained in:
parent
e1c6f864b2
commit
063562c986
2 changed files with 4 additions and 4 deletions
|
@ -443,10 +443,10 @@ class Int64Range(Gst.Int64Range):
|
|||
|
||||
class Bitmask(Gst.Bitmask):
|
||||
def __init__(self, v):
|
||||
if not isinstance(v, int):
|
||||
raise TypeError("%s is not an int." % (type(v)))
|
||||
if not isinstance(v, long) and not isinstance(v, int):
|
||||
raise TypeError("%s is not an int or long." % (type(v)))
|
||||
|
||||
self.v = v
|
||||
self.v = long(v)
|
||||
|
||||
def __str__(self):
|
||||
return hex(self.v)
|
||||
|
|
|
@ -396,4 +396,4 @@ class TestBitmask(TestCase):
|
|||
Gst.init(None)
|
||||
|
||||
r = Gst.Bitmask(1 << 5)
|
||||
self.assertEqual(str(r), '0x20')
|
||||
self.assertEqual(str(r), '0x20L')
|
||||
|
|
Loading…
Reference in a new issue