summaryrefslogtreecommitdiff
path: root/python_modules
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2018-04-10 16:29:06 -0500
committerFrediano Ziglio <fziglio@redhat.com>2018-04-17 14:14:22 +0100
commit885b1a6bb9e3644e01a1d4f11376febc6145e526 (patch)
tree8b47a0c7a6d041f24723782a4cb3193389c2f165 /python_modules
parent4c2d0e977272c5540634d24f485dd64c424f6748 (diff)
Remove extra self parameter from member function
When testing out some experimental protocol changes, I managed to trigger the following error: GEN generated_client_demarshallers.c Traceback (most recent call last): File "../../../spice-common/spice_codegen.py", line 267, in <module> demarshal.write_protocol_parser(writer, proto, True) File "/home/jjongsma/work/spice/spice-common/python_modules/demarshal.py", line 1270, in write_protocol_parser parsers[channel.value] = (channel.channel_type, write_channel_parser(writer, channel.channel_type, is_server)) File "/home/jjongsma/work/spice/spice-common/python_modules/demarshal.py", line 1163, in write_channel_parser func = write_msg_parser(helpers, ids[i].message_type) File "/home/jjongsma/work/spice/spice-common/python_modules/demarshal.py", line 1061, in write_msg_parser num_pointers = message.get_num_pointers() File "/home/jjongsma/work/spice/spice-common/python_modules/ptypes.py", line 855, in get_num_pointers count = count + m.get_num_pointers() File "/home/jjongsma/work/spice/spice-common/python_modules/ptypes.py", line 662, in get_num_pointers return self.member_type.get_num_pointers() File "/home/jjongsma/work/spice/spice-common/python_modules/ptypes.py", line 507, in get_num_pointers if self.is_constant_length(self): TypeError: is_constant_length() takes exactly 1 argument (2 given) Calling a member function will implicitly pass 'self' as the first argument, but we were also explicitly passing it as an argument (self.is_constant_length(self)). This resulted in the above error. Acked-by: Lukáš Hrázký <lhrazky@redhat.com>
Diffstat (limited to 'python_modules')
-rw-r--r--python_modules/ptypes.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py
index 63a7a2f..d29c97a 100644
--- a/python_modules/ptypes.py
+++ b/python_modules/ptypes.py
@@ -504,7 +504,7 @@ class ArrayType(Type):
element_count = self.element_type.get_num_pointers()
if element_count == 0:
return 0
- if self.is_constant_length(self):
+ if self.is_constant_length():
return element_count * self.size
raise Exception("Pointers in dynamic arrays not supported")