From 600fcbc1a2d723f8d51e5f5ab6d9e4c389010e1c Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 11 May 2010 11:01:45 +0200 Subject: Repo: Added comparison operators and hash operator including test Cmd: AutoInterrupt handles boundary cases more gracefully as it can be that the os module suddenly becomes None if the interpreter is going down --- lib/git/cmd.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/git/cmd.py') diff --git a/lib/git/cmd.py b/lib/git/cmd.py index 60912142..254b7dd3 100644 --- a/lib/git/cmd.py +++ b/lib/git/cmd.py @@ -63,8 +63,12 @@ class Git(object): def __del__(self): # did the process finish already so we have a return code ? if self.proc.poll() is not None: - return - + return + + # can be that nothing really exists anymore ... + if os is None: + return + # try to kill it try: os.kill(self.proc.pid, 2) # interrupt signal -- cgit v1.2.1