[nanny/win32: 69/75] catch exception if nanny-desktop-blocker fails WIN32
- From: Roberto Majadas <telemaco src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nanny/win32: 69/75] catch exception if nanny-desktop-blocker fails WIN32
- Date: Tue, 2 Nov 2010 18:56:45 +0000 (UTC)
commit b2114904242bef67eb58f01e1e738b53694d31b9
Author: Roberto Majadas <roberto majadas openshine com>
Date: Mon Nov 1 13:14:12 2010 +0100
catch exception if nanny-desktop-blocker fails WIN32
daemon/src/Win32SessionFiltering.py | 29 ++++++++++++++++-------------
1 files changed, 16 insertions(+), 13 deletions(-)
---
diff --git a/daemon/src/Win32SessionFiltering.py b/daemon/src/Win32SessionFiltering.py
index 54d0724..02c36ff 100644
--- a/daemon/src/Win32SessionFiltering.py
+++ b/daemon/src/Win32SessionFiltering.py
@@ -112,19 +112,22 @@ class Win32SessionBlocker(gobject.GObject) :
def __launch_blocker_thread(self, user_id, win32sb):
import subprocess
import time
-
- p = WinPopenAsUser(win32sb.sb)
- print "[W32SessionFiltering] launching blocker (pid : %s)" % p.pid
- while p.poll() == None :
- time.sleep(1)
- b = threads.blockingCallFromThread(reactor, win32sb.is_user_blocked, user_id)
- if b == False:
- p.kill()
- print "[W32SessionFiltering] Unblocking session %s" % user_id
- return
-
- print "[W32SessionFiltering] blocker terminated by user interaction"
- threads.blockingCallFromThread(reactor, win32sb.blocker_terminate_from_thread, user_id, p.poll())
+ try:
+ p = WinPopenAsUser(win32sb.sb)
+ print "[W32SessionFiltering] launching blocker (pid : %s)" % p.pid
+ while p.poll() == None :
+ time.sleep(1)
+ b = threads.blockingCallFromThread(reactor, win32sb.is_user_blocked, user_id)
+ if b == False:
+ p.kill()
+ print "[W32SessionFiltering] Unblocking session %s" % user_id
+ return
+
+ print "[W32SessionFiltering] blocker terminated by user interaction"
+ threads.blockingCallFromThread(reactor, win32sb.blocker_terminate_from_thread, user_id, p.poll())
+ except:
+ print "[W32SessionFiltering] blocker terminated by exception"
+ threads.blockingCallFromThread(reactor, win32sb.blocker_terminate_from_thread, user_id, 1)
class WinPopenAsUser :
def __init__ (self, cmd):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]