From ee71bcfbe8a5be7f0b0bbe747ea65a3f7ca137be Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 11 Sep 2011 09:06:46 +1200 Subject: [PATCH] Fix a rare crash when a new cert is generated during cerdir removal. --- libmproxy/proxy.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py index d1596b0af..7b6e695f6 100644 --- a/libmproxy/proxy.py +++ b/libmproxy/proxy.py @@ -445,8 +445,11 @@ class ProxyServer(ServerBase): self.RequestHandlerClass(self.config, request, client_address, self, self.masterq) def shutdown(self): - shutil.rmtree(self.certdir) ServerBase.shutdown(self) + try: + shutil.rmtree(self.certdir) + except OSError: + pass # Command-line utils