3 ๘šJZม ใ@sTGdd„deƒZGdd„deƒZGdd„deƒZGdd„deƒZGdd „d eƒZd S) c@s&eZdZdZddd„Zdd„ZeZdS) ฺErrorzQBase exception class. All other psutil exceptions inherit from this one. ฺcCstj||ƒ||_dS)N)ฺ Exceptionฺ__init__ฺmsg)ฺselfrฉr๚#/usr/lib64/python3.6/_exceptions.pyr s zError.__init__cCsd|jj|jf}|jƒS)Nz psutil.%s %s)ฺ __class__ฺ__name__rฺstrip)rฺretrrrฺ__repr__szError.__repr__N)r)r ฺ __module__ฺ __qualname__ฺ__doc__rr ฺ__str__rrrrrs rc@seZdZdZddd„ZdS)ฺ NoSuchProcesszXException raised when a process with a certain PID doesn't or no longer exists. NcCsXtj||ƒ||_||_||_|dkrT|r@d|jt|jƒf}n d|j}d||_dS)Nz(pid=%s, name=%s)z(pid=%s)zprocess no longer exists )rrฺpidฺnamerฺrepr)rrrrฺdetailsrrrrs  zNoSuchProcess.__init__)NN)r rrrrrrrrrsrc@seZdZdZddd„ZdS)ฺ ZombieProcessa/Exception raised when querying a zombie process. This is raised on OSX, BSD and Solaris only, and not always: depending on the query the OS may be able to succeed anyway. On Linux all zombie processes are querable (hence this is never raised). Windows doesn't have zombie processes. NcCs~tj||ƒ||_||_||_||_|dkrzd|g}|rN|jdt|jƒƒ|rb|jd|jƒddj|ƒ}d||_dS)Nzpid=%szname=%szppid=%sz(%s)z, z'process still exists but it's a zombie ) rrrฺppidrrฺappendrฺjoin)rrrrrฺargsrrrrr0s  zZombieProcess.__init__)NNN)r rrrrrrrrr(src@seZdZdZddd„ZdS)ฺ AccessDeniedz@Exception raised when permission to perform an action is denied.NcCsjtj||ƒ||_||_||_|dkrf|dk rJ|dk rJd|t|ƒf|_n|dk r`d|j|_nd|_dS)Nz(pid=%s, name=%s)z(pid=%s)r)rrrrrr)rrrrrrrrCs zAccessDenied.__init__)NNN)r rrrrrrrrr@src@seZdZdZddd„ZdS)ฺTimeoutExpiredzWRaised on Process.wait(timeout) if timeout expires and process is still alive. NcCsntj|d|ƒ||_||_||_|dk rN|dk rN|jd|t|ƒf7_n|dk rj|jd|j7_dS)Nztimeout after %s secondsz (pid=%s, name=%s)z (pid=%s))rrฺsecondsrrrr)rrrrrrrrVszTimeoutExpired.__init__)NN)r rrrrrrrrrQsrN)rrrrrrrrrrฺs