Patchwork [3,of,5,in,crew] mail: add missing import of sys

login
register
mail settings
Submitter Bryan O'Sullivan
Date April 13, 2013, 12:20 a.m.
Message ID <6edb0e18b83c441dcdee.1365812444@australite.local>
Download mbox | patch
Permalink /patch/1291/
State Accepted
Commit 6edb0e18b83c441dcdee7146f40f49c79a2c69e1
Headers show

Comments

Bryan O'Sullivan - April 13, 2013, 12:20 a.m.
# HG changeset patch
# User Bryan O'Sullivan <bryano@fb.com>
# Date 1365812255 25200
#      Fri Apr 12 17:17:35 2013 -0700
# Node ID 6edb0e18b83c441dcdee7146f40f49c79a2c69e1
# Parent  169030d9255eb6d9189760b52a72c8d2a1ef45c6
mail: add missing import of sys

Found using Cython.

Patch

diff --git a/mercurial/mail.py b/mercurial/mail.py
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -7,7 +7,7 @@ 
 
 from i18n import _
 import util, encoding, sslutil
-import os, smtplib, socket, quopri, time
+import os, smtplib, socket, quopri, time, sys
 import email.Header, email.MIMEText, email.Utils
 
 _oldheaderinit = email.Header.Header.__init__
@@ -72,7 +72,7 @@  if util.safehasattr(smtplib.SMTP, '_get_
 
         def _get_socket(self, host, port, timeout):
             if self.debuglevel > 0:
-                print >> stderr, 'connect:', (host, port)
+                print >> sys.stderr, 'connect:', (host, port)
             new_socket = socket.create_connection((host, port), timeout)
             new_socket = sslutil.ssl_wrap_socket(new_socket,
                                                  self.keyfile, self.certfile,