Small optimization in w_std()/w_err() 'avoid the dot'.
--- a/VirtualMailManager/__init__.py Thu Sep 03 05:33:52 2009 +0000
+++ b/VirtualMailManager/__init__.py Fri Sep 04 19:38:50 2009 +0000
@@ -19,18 +19,20 @@
def w_std(*args):
"""Writes each arg of args, encoded in the current ENCODING, to stdout and
appends a newline."""
+ _write = os.sys.stdout.write
for arg in args:
- os.sys.stdout.write(arg.encode(ENCODING, 'replace'))
- os.sys.stdout.write('\n')
+ _write(arg.encode(ENCODING, 'replace'))
+ _write('\n')
def w_err(code, *args):
"""Writes each arg of args, encoded in the current ENCODING, to stderr and
appends a newline.
This function additional interrupts the program execution and uses 'code'
system exit status."""
+ _write = os.sys.stderr.write
for arg in args:
- os.sys.stderr.write(arg.encode(ENCODING, 'replace'))
- os.sys.stderr.write('\n')
+ _write(arg.encode(ENCODING, 'replace'))
+ _write('\n')
os.sys.exit(code)
__all__ = [