diff options
author | Julien Danjou <julien@danjou.info> | 2012-03-22 21:27:02 +0100 |
---|---|---|
committer | Julien Danjou <julien@danjou.info> | 2012-03-22 21:27:02 +0100 |
commit | c5ff7fbf5a53cc20984a20d5461be2fc1f1eac39 (patch) | |
tree | 90bd040b9b68b9519c8e3d0cfface3d915826bef | |
parent | 734b156062e020335a3352fc60b0745706db9074 (diff) |
Fix building with latest xcbgen
Signed-off-by: Julien Danjou <julien@danjou.info>
-rwxr-xr-x | src/py_client.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/py_client.py b/src/py_client.py index 961c60c..61be2ae 100755 --- a/src/py_client.py +++ b/src/py_client.py @@ -261,7 +261,11 @@ def _py_get_length_field(expr): ''' if expr.lenfield_name != None: # This would be nicer if Request had an is_request attribute... - if hasattr(expr.parent.parent, "opcode"): + try: + has_opcode = hasattr(expr.parent.parents, "opcode") + except AttributeError: + has_opcode = False + if has_opcode: return expr.lenfield_name else: return 'self.%s' % expr.lenfield_name |