Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit af18a01

Browse files
author
Matthias Koeppe
committed
Use sys.stdout.write instead of print
1 parent 7e34340 commit af18a01

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# @configure_input@
22

3-
from __future__ import print_function
4-
del print_function
5-
63
VERSION = "@PACKAGE_VERSION@"
74

85
MAXIMA = "@prefix@/bin/maxima"
@@ -16,19 +13,19 @@ SAGE_ROOT = "@abs_top_srcdir@"
1613

1714
def _main():
1815
from argparse import ArgumentParser
19-
from sys import exit, stderr
16+
from sys import exit, stdout
2017
parser = ArgumentParser()
2118
parser.add_argument('--version', help="show version", action="version",
2219
version='%(prog)s ' + VERSION)
2320
parser.add_argument("VARIABLE", nargs='?', help="output the value of VARIABLE")
2421
args = parser.parse_args()
2522
d = globals()
2623
if args.VARIABLE:
27-
print(d[args.VARIABLE])
24+
stdout.write('{}\n'.format(d[args.VARIABLE]))
2825
else:
2926
for k, v in d.items():
3027
if not k.startswith('_'):
31-
print('{}={}'.format(k, v))
28+
stdout.write('{}={}\n'.format(k, v))
3229

3330
if __name__ == "__main__":
3431
_main()

0 commit comments

Comments
 (0)