From 5a0b07c1be079b47ccd776fdd6eb5cefbab678eb Mon Sep 17 00:00:00 2001 From: Terje Sandstrom Date: Mon, 9 Dec 2019 13:47:55 +0100 Subject: [PATCH] fix for stderr crash --- listgits/listgits.py | 7 +++++-- setup.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/listgits/listgits.py b/listgits/listgits.py index 24b51e0..3816b0d 100644 --- a/listgits/listgits.py +++ b/listgits/listgits.py @@ -26,8 +26,11 @@ def listgits(cwd,level,short,local,remotes,isSearch,gitoptions,results): else: git = git + ['remote','-v'] proc = subprocess.Popen(git,stdout=subprocess.PIPE,stderr=subprocess.PIPE) - stdout = proc.communicate()[0].decode("utf-8").split('\n') - stderr = proc.communicate()[1].decode("utf-8").split('\n') + stdout_value, stderr_value = proc.communicate() + stdout = stdout_value.decode("utf-8").split('\n') + stderr = [] + if stderr_value is not None: + stderr = stderr_value.decode("utf-8").split('\n') if len(stdout[0])==0: if not remotes and not isSearch: print (spc+'Folder '+root+'/'+dir+' has local repo only') diff --git a/setup.py b/setup.py index f0e447c..c25b6d5 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="listgits", - version="1.0.1", + version="1.0.3", author="Terje Sandstrom", author_email="terje@hermit.no", description="Python command line program for listing git repositories under a folder root, and optionally run any git command on those repos",