summaryrefslogtreecommitdiff
path: root/tests/test_pretty_print.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_pretty_print.py')
-rwxr-xr-xtests/test_pretty_print.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/test_pretty_print.py b/tests/test_pretty_print.py
index a2a04ed..ed86b65 100755
--- a/tests/test_pretty_print.py
+++ b/tests/test_pretty_print.py
@@ -62,13 +62,16 @@ def ezsearch(pattern,str):
def read_gitinfo():
# won't work if run from outside of branch.
- data = subprocess.Popen(['git','remote','-v'],stdout=subprocess.PIPE).stdout.read()
- origin = ezsearch('^origin *?(.*?)\(fetch.*?$',data)
- upstream = ezsearch('^upstream *?(.*?)\(fetch.*?$',data)
- data = subprocess.Popen(['git','branch'],stdout=subprocess.PIPE).stdout.read()
- branch = ezsearch('^\*(.*?)$',data)
- out = 'Git branch: ' + branch + ' from origin ' + origin + '\n'
- out += 'Git upstream: ' + upstream + '\n'
+ try:
+ data = subprocess.Popen(['git','remote','-v'],stdout=subprocess.PIPE).stdout.read()
+ origin = ezsearch('^origin *?(.*?)\(fetch.*?$',data)
+ upstream = ezsearch('^upstream *?(.*?)\(fetch.*?$',data)
+ data = subprocess.Popen(['git','branch'],stdout=subprocess.PIPE).stdout.read()
+ branch = ezsearch('^\*(.*?)$',data)
+ out = 'Git branch: ' + branch + ' from origin ' + origin + '\n'
+ out += 'Git upstream: ' + upstream + '\n'
+ except:
+ out = 'Problem running git'
return out
def read_sysinfo(filename):
contact: Jan Huwald // Impressum