# HG changeset patch # User Pascal Volk # Date 1252093130 0 # Node ID ecd6a379e52357c5de6f378de3b64918327ef37b # Parent ffac064bd728844916e9b5b4061bda9c7372b816 Small optimization in w_std()/w_err() 'avoid the dot'. diff -r ffac064bd728 -r ecd6a379e523 VirtualMailManager/__init__.py --- 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__ = [