Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcc4361c

Browse files
get_process_children is updated
1 parent230e562 commitcc4361c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

‎testgres/operations/local_ops.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ def get_pid(self):
418418
returnos.getpid()
419419

420420
defget_process_children(self,pid):
421+
asserttype(pid)==int# noqa: E721
421422
returnpsutil.Process(pid).children()
422423

423424
# Database control

‎testgres/operations/remote_ops.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,15 +599,16 @@ def get_pid(self):
599599
returnint(self.exec_command("echo $$",encoding=get_default_encoding()))
600600

601601
defget_process_children(self,pid):
602-
command= ["ssh"]+self.ssh_args+ [self.ssh_dest,f"pgrep -P{pid}"]
602+
asserttype(pid)==int# noqa: E721
603+
command= ["ssh"]+self.ssh_args+ [self.ssh_dest,"pgrep","-P",str(pid)]
603604

604605
result=subprocess.run(command,stdout=subprocess.PIPE,stderr=subprocess.PIPE,text=True)
605606

606607
ifresult.returncode==0:
607608
children=result.stdout.strip().splitlines()
608609
return [PsUtilProcessProxy(self,int(child_pid.strip()))forchild_pidinchildren]
609-
else:
610-
raiseExecUtilException(f"Error in getting process children. Error:{result.stderr}")
610+
611+
raiseExecUtilException(f"Error in getting process children. Error:{result.stderr}")
611612

612613
# Database control
613614
defdb_connect(self,dbname,user,password=None,host="localhost",port=5432):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp