Index: third_party/psutil/psutil/error.py |
diff --git a/third_party/psutil/psutil/error.py b/third_party/psutil/psutil/error.py |
index 214a241b993af1ac39b32a8ef4e9c3a156eada8a..0298cb9475530c015408bef34818e2230fc4f8a6 100644 |
--- a/third_party/psutil/psutil/error.py |
+++ b/third_party/psutil/psutil/error.py |
@@ -1,9 +1,12 @@ |
#!/usr/bin/env python |
# |
-# $Id: error.py 744 2010-10-27 22:42:42Z jloden $ |
+# $Id: error.py 1142 2011-10-05 18:45:49Z g.rodola $ |
# |
+# Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
-"""psutil exception classes""" |
+"""psutil exception classes; do not import this directly""" |
class Error(Exception): |
@@ -49,3 +52,22 @@ class AccessDenied(Error): |
def __str__(self): |
return self.msg |
+ |
+class TimeoutExpired(Error): |
+ """Raised on Process.wait(timeout) if timeout expires and process |
+ is still alive. |
+ """ |
+ |
+ def __init__(self, pid=None, name=None): |
+ self.pid = pid |
+ self.name = name |
+ if (pid is not None) and (name is not None): |
+ self.msg = "(pid=%s, name=%s)" % (pid, repr(name)) |
+ elif (pid is not None): |
+ self.msg = "(pid=%s)" % self.pid |
+ else: |
+ self.msg = "" |
+ |
+ def __str__(self): |
+ return self.msg |
+ |