summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2010-03-10 19:05:12 +0000
committerJonny Lamb <jonny.lamb@collabora.co.uk>2010-03-10 19:05:12 +0000
commita623932218d17d1f8c95261bda392b19031ffc0e (patch)
treec01e3776575adffb714a8b2772c78afb762d6bf3 /src
parent8e79fe1b5ef5ab503dc85fb64509af9ce88ca9f6 (diff)
channelmanager: return None as the handle if TargetHandleType=NONE
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/server/channelmanager.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/server/channelmanager.py b/src/server/channelmanager.py
index 7ebe241..ef8dd85 100644
--- a/src/server/channelmanager.py
+++ b/src/server/channelmanager.py
@@ -50,12 +50,18 @@ class ChannelManager(object):
def _get_type_requested_handle(self, props):
"""Return the type, request and target handle from the requested
properties"""
+ handle = None
+
type = props[CHANNEL_INTERFACE + '.ChannelType']
requested = props[CHANNEL_INTERFACE + '.Requested']
- target_handle = props[CHANNEL_INTERFACE + '.TargetHandle']
- target_handle_type = props[CHANNEL_INTERFACE + '.TargetHandleType']
- handle = self._conn._handles[target_handle_type, target_handle]
+ try:
+ target_handle_type = props[CHANNEL_INTERFACE + '.TargetHandleType']
+ target_handle = props[CHANNEL_INTERFACE + '.TargetHandle']
+ handle = self._conn._handles[target_handle_type, target_handle]
+ except KeyError:
+ # if TargetHandleType=NONE
+ pass
return (type, requested, handle)