← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/python-pgbouncer/py3 into lp:python-pgbouncer

 

Colin Watson has proposed merging lp:~cjwatson/python-pgbouncer/py3 into lp:python-pgbouncer with lp:~cjwatson/python-pgbouncer/tox as a prerequisite.

Commit message:
Add Python 3 support.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/python-pgbouncer/py3/+merge/368551
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/python-pgbouncer/py3 into lp:python-pgbouncer.
=== modified file '.bzrignore'
--- .bzrignore	2019-06-07 15:29:45 +0000
+++ .bzrignore	2019-06-07 15:29:45 +0000
@@ -1,5 +1,6 @@
 ./.tox
 ./MANIFEST
 ./pgbouncer.egg-info
+__pycache__
 TAGS
 tags

=== modified file 'NEWS.txt'
--- NEWS.txt	2019-06-07 15:29:45 +0000
+++ NEWS.txt	2019-06-07 15:29:45 +0000
@@ -3,6 +3,7 @@
 
 - Use postgresfixture to test against multiple PostgreSQL versions.
 - Switch to tox.
+- Add Python 3 support.
 
 0.0.8 (2012-08-20)
 ==================

=== modified file 'pgbouncer/fixture.py'
--- pgbouncer/fixture.py	2012-08-13 20:53:04 +0000
+++ pgbouncer/fixture.py	2019-06-07 15:29:45 +0000
@@ -52,11 +52,11 @@
     port, and the time it actually gets used), but for the purposes for which
     this function gets used it isn't a problem in practice.
     """
-    sockets = map(lambda _: socket.socket(), xrange(n))
+    sockets = [socket.socket() for _ in range(n)]
     try:
         for s in sockets:
             s.bind(('localhost', 0))
-        return map(lambda s: s.getsockname()[1], sockets)
+        return [s.getsockname()[1] for s in sockets]
     finally:
         for s in sockets:
             s.close()

=== modified file 'setup.py'
--- setup.py	2019-06-07 15:29:45 +0000
+++ setup.py	2019-06-07 15:29:45 +0000
@@ -37,6 +37,8 @@
           'License :: OSI Approved :: GNU Affero General Public License v3',
           'Operating System :: OS Independent',
           'Programming Language :: Python',
+          'Programming Language :: Python :: 2',
+          'Programming Language :: Python :: 3',
           ],
       install_requires = [
           'fixtures',

=== modified file 'tox.ini'
--- tox.ini	2019-06-07 15:29:45 +0000
+++ tox.ini	2019-06-07 15:29:45 +0000
@@ -1,6 +1,7 @@
 [tox]
 envlist =
     py27
+    py35
 
 [testenv]
 deps =