diff --git a/psutil/_pswindows.py b/psutil/_pswindows.py index 77d9140cd..2d3a0c9fd 100644 --- a/psutil/_pswindows.py +++ b/psutil/_pswindows.py @@ -575,14 +575,12 @@ def _wrap_exceptions(self): "service %r is not querable (not enough privileges)" % self._name ) - raise AccessDenied( - pid=None, name=self._name, msg=msg % self._name - ) + raise AccessDenied(pid=None, name=self._name, msg=msg) elif err.winerror in ( cext.ERROR_INVALID_NAME, cext.ERROR_SERVICE_DOES_NOT_EXIST, ): - msg = "service %r does not exist)" % self._name + msg = "service %r does not exist" % self._name raise NoSuchProcess(pid=None, name=self._name, msg=msg) else: raise