-try:
- out = subprocess.Popen(["buildbot", "--version"],
- stdout=subprocess.PIPE).communicate()[0]
- print "buildbot:", out.replace("\n", " ")
-except EnvironmentError, le:
- sys.stderr.write("Got exception invoking 'buildbot': %s" % (le,))
- pass
+def print_as_ver():
+ if os.path.exists('a.out'):
+ print
+ print "WARNING: a file named a.out exists, and getting the version of the 'as' assembler writes to that filename, so I'm not attempting to get the version of 'as'."
+ return
+ try:
+ res = subprocess.Popen(['as', '-version'], stdin=open(os.devnull),
+ stderr=subprocess.PIPE).communicate()[1]
+ print
+ print 'as: ' + res.replace("\n", " ")
+ os.remove('a.out')
+ except EnvironmentError, le:
+ sys.stderr.write("Got exception invoking '%s': %s\n" % ('as', le,))
+ pass