equal
deleted
inserted
replaced
29 |
29 |
30 def w_std(*args): |
30 def w_std(*args): |
31 """Writes a line for each arg of *args*, encoded in the current |
31 """Writes a line for each arg of *args*, encoded in the current |
32 ENCODING, to stdout. |
32 ENCODING, to stdout. |
33 """ |
33 """ |
34 _std_write('\n'.join(a.encode(ENCODING, 'replace') for a in args) + '\n') |
34 _std_write('\n'.join(arg.encode(ENCODING, 'replace').decode() |
|
35 for arg in args) + '\n') |
35 |
36 |
36 |
37 |
37 def w_err(code, *args): |
38 def w_err(code, *args): |
38 """Writes a line for each arg of *args*, encoded in the current |
39 """Writes a line for each arg of *args*, encoded in the current |
39 ENCODING, to stderr. |
40 ENCODING, to stderr. |
40 This function optionally interrupts the program execution if *code* |
41 This function optionally interrupts the program execution if *code* |
41 does not equal to 0. *code* will be used as the system exit status. |
42 does not equal to 0. *code* will be used as the system exit status. |
42 """ |
43 """ |
43 _err_write('\n'.join(a.encode(ENCODING, 'replace') for a in args) + '\n') |
44 _err_write('\n'.join(arg.encode(ENCODING, 'replace').decode() |
|
45 for arg in args) + '\n') |
44 if code: |
46 if code: |
45 os.sys.exit(code) |
47 os.sys.exit(code) |
46 |
48 |
47 |
49 |
48 def get_winsize(): |
50 def get_winsize(): |