[Python-modules-commits] [pytest-localserver] 03/05: py35-fix

Daniel Stender danstender-guest at moszumanska.debian.org
Sun Oct 25 18:10:06 UTC 2015


This is an automated email from the git hooks/post-receive script.

danstender-guest pushed a commit to branch master
in repository pytest-localserver.

commit 44aa43e9e0e4d31a00bdb403e5670c790aafe475
Author: Daniel Stender <debian at danielstender.com>
Date:   Sun Oct 25 18:37:33 2015 +0100

    py35-fix
    
       fixes problems of SMTP server component with Python 3.5
       Origin: https://bitbucket.org/pytest-dev/pytest-localserver/issues/13/broken-on-python-35
       Bug: https://bugs.debian.org/801302
---
 pytest_localserver/smtp.py | 2 +-
 tests/test_smtp.py         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pytest_localserver/smtp.py b/pytest_localserver/smtp.py
index d5b945c..8ea4332 100644
--- a/pytest_localserver/smtp.py
+++ b/pytest_localserver/smtp.py
@@ -34,7 +34,7 @@ class Server (smtpd.SMTPServer, threading.Thread):
     def __init__(self, host='localhost', port=0):
         smtpd.SMTPServer.__init__(self, (host, port), None)
         if self._localaddr[1] == 0:
-            self.addr = self.getsockname()
+            self.addr = self.socket.getsockname()
 
         self.outbox = []
 
diff --git a/tests/test_smtp.py b/tests/test_smtp.py
index 6f74174..ce302b4 100644
--- a/tests/test_smtp.py
+++ b/tests/test_smtp.py
@@ -21,7 +21,7 @@ def send_plain_email(to, from_, subject, txt, server=('localhost', 25)):
     msg['From'] = from_
     msg['To'] = to
 
-    host, port = server
+    host, port = server[:2]
     server = smtplib.SMTP(host, port)
     server.set_debuglevel(1)
     server.sendmail(from_, to, msg.as_string())

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pytest-localserver.git



More information about the Python-modules-commits mailing list