- return p.stdout.read(), p.stderr.read()
- if v:
- print >> sys.stderr, 'Error', v, 'on remctl', args, ':'
- print >> sys.stderr, p.stderr.read()
+ return stdout, stderr
+ if p.returncode:
+ print('Error', p.returncode, 'on remctl', args, ':', file=sys.stderr)
+ print(stderr, file=sys.stderr)