From d18a9cd12ffbe017feee86597d5e6f701f31da47 Mon Sep 17 00:00:00 2001 From: Randall Leeds Date: Thu, 22 Dec 2016 15:36:05 -0800 Subject: [PATCH] catch access denied to pid file fix #1091 --- gunicorn/pidfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gunicorn/pidfile.py b/gunicorn/pidfile.py index 7f7f844f..a6e085fd 100644 --- a/gunicorn/pidfile.py +++ b/gunicorn/pidfile.py @@ -75,6 +75,8 @@ class Pidfile(object): os.kill(wpid, 0) return wpid except OSError as e: + if e.args[0] == errno.EPERM: + return wpid if e.args[0] == errno.ESRCH: return raise