summaryrefslogtreecommitdiff
path: root/src/py_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/py_client.py')
-rwxr-xr-xsrc/py_client.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/py_client.py b/src/py_client.py
index c056fd6..c25e39d 100755
--- a/src/py_client.py
+++ b/src/py_client.py
@@ -257,7 +257,11 @@ def _py_get_length_field(expr):
Otherwise, just reference the structure field directly.
'''
if expr.lenfield_name != None:
- return 'self.%s' % expr.lenfield_name
+ # This would be nicer if Request had an is_request attribute...
+ if hasattr(expr.parent.parent, "opcode"):
+ return expr.lenfield_name
+ else:
+ return 'self.%s' % expr.lenfield_name
else:
return str(expr.nmemb)