@@ -20,10 +20,14 @@ def process_alive(host, pid, thread):
2020 from . import local_pid_alive
2121 from . import hostid
2222
23- assert isinstance (host, str )
24- assert isinstance (hostid, str )
25- assert isinstance (pid, int )
26- assert isinstance (thread, int )
23+ if not isinstance (host, str ):
24+ raise TypeError (" host must be a string" )
25+ if not isinstance (hostid, str ):
26+ raise TypeError (" hostid must be a string" )
27+ if not isinstance (pid, int ):
28+ raise TypeError (" pid must be an integer" )
29+ if not isinstance (thread, int ):
30+ raise TypeError (" thread must be an integer" )
2731
2832 if host != hostid:
2933 return True
@@ -55,7 +59,8 @@ def local_pid_alive(pid):
5559
5660def posix_acl_use_stored_uid_gid (acl ):
5761 """ Replace the user/group field with the stored uid/gid."""
58- assert isinstance (acl, bytes)
62+ if not isinstance (acl, bytes):
63+ raise TypeError (" acl must be of type bytes" )
5964 from ..helpers import safe_decode, safe_encode
6065 entries = []
6166 for entry in safe_decode(acl).split(' \n ' ):
0 commit comments