test rpc: remove unnecessary import, close fd

Submitted by Adrian Reber on June 29, 2018, 12:50 p.m.

Details

Message ID 1530276607-8236-1-git-send-email-adrian@lisas.de
State Accepted
Series "test rpc: remove unnecessary import, close fd"
Commit 931907726f7ca79cb53d66e57457330e3ded3ec3
Headers show

Commit Message

Adrian Reber June 29, 2018, 12:50 p.m.
From: Adrian Reber <areber@redhat.com>

Signed-off-by: Adrian Reber <areber@redhat.com>
---
 test/others/rpc/read.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/test/others/rpc/read.py b/test/others/rpc/read.py
index 680069b..bbf69b6 100644
--- a/test/others/rpc/read.py
+++ b/test/others/rpc/read.py
@@ -5,12 +5,11 @@ 
 # but the bash version on Ubuntu has probably the following bug:
 # https://lists.gnu.org/archive/html/bug-bash/2017-07/msg00039.html
 
-import os
 import sys
 
-
-f=open(sys.argv[1])
+f = open(sys.argv[1])
 r = f.read(1)
+f.close()
 
 if r == '\0':
 	sys.exit(0)

Comments

Andrey Vagin July 11, 2018, 12:08 a.m.
Applied, thanks

On Fri, Jun 29, 2018 at 12:50:07PM +0000, Adrian Reber wrote:
> From: Adrian Reber <areber@redhat.com>
> 
> Signed-off-by: Adrian Reber <areber@redhat.com>
> ---
>  test/others/rpc/read.py | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/test/others/rpc/read.py b/test/others/rpc/read.py
> index 680069b..bbf69b6 100644
> --- a/test/others/rpc/read.py
> +++ b/test/others/rpc/read.py
> @@ -5,12 +5,11 @@
>  # but the bash version on Ubuntu has probably the following bug:
>  # https://lists.gnu.org/archive/html/bug-bash/2017-07/msg00039.html
>  
> -import os
>  import sys
>  
> -
> -f=open(sys.argv[1])
> +f = open(sys.argv[1])
>  r = f.read(1)
> +f.close()
>  
>  if r == '\0':
>  	sys.exit(0)
> -- 
> 1.8.3.1
>