From 60b3d8274f85e1b7c47dd7bf413c808cc850afee Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Mon, 27 Mar 2017 19:18:35 +0900 Subject: [PATCH 1/2] remove unused util.join_bytes() --- pymysql/tests/test_nextset.py | 1 - pymysql/util.py | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/pymysql/tests/test_nextset.py b/pymysql/tests/test_nextset.py index cdb6754..adc6a2e 100644 --- a/pymysql/tests/test_nextset.py +++ b/pymysql/tests/test_nextset.py @@ -1,7 +1,6 @@ import unittest2 from pymysql.tests import base -from pymysql import util class TestNextset(base.PyMySQLTestCase): diff --git a/pymysql/util.py b/pymysql/util.py index 3e82ac7..1349ec7 100644 --- a/pymysql/util.py +++ b/pymysql/util.py @@ -10,13 +10,3 @@ def byte2int(b): def int2byte(i): return struct.pack("!B", i) - - -def join_bytes(bs): - if len(bs) == 0: - return "" - else: - rv = bs[0] - for b in bs[1:]: - rv += b - return rv From 84c793b933d930d1488df886813402ad6609af9f Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Mon, 27 Mar 2017 19:39:56 +0900 Subject: [PATCH 2/2] drop Python 2.7 and ~3.4. --- .travis.yml | 9 +++++---- README.rst | 8 ++++---- pymysql/connections.py | 22 ---------------------- setup.py | 3 ++- 4 files changed, 11 insertions(+), 31 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6588822..b64dcd1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,8 @@ language: python python: - "3.7-dev" - "3.6" - - "2.6" + - "3.5" + - "2.7" - "pypy3.3-5.2-alpha1" cache: pip @@ -13,7 +14,7 @@ matrix: include: - addons: mariadb: 5.5 - python: "3.5" + python: "3.6" - addons: mariadb: 10.0 @@ -29,7 +30,7 @@ matrix: apt: packages: - libaio-dev - python: "3.3" + python: "3.6" - env: - DB=5.7.17 @@ -37,7 +38,7 @@ matrix: apt: packages: - libaio-dev - python: "3.4" + python: "3.6" diff --git a/README.rst b/README.rst index b8f9c89..4e3ffa3 100644 --- a/README.rst +++ b/README.rst @@ -33,7 +33,7 @@ Requirements * Python -- one of the following: - - CPython_ >= 2.6 or >= 3.3 + - CPython_ >= 2.7 or >= 3.5 - PyPy_ >= 4.0 - IronPython_ 2.7 @@ -42,10 +42,10 @@ Requirements - MySQL_ >= 4.1 (tested with only 5.5~) - MariaDB_ >= 5.1 -.. _CPython: http://www.python.org/ +.. _CPython: https://www.python.org/ .. _PyPy: http://pypy.org/ .. _IronPython: http://ironpython.net/ -.. _MySQL: http://www.mysql.com/ +.. _MySQL: https://www.mysql.com/ .. _MariaDB: https://mariadb.org/ @@ -60,7 +60,7 @@ The last stable release is available on PyPI and can be installed with ``pip``:: Documentation ------------- -Documentation is available online: http://pymysql.readthedocs.io/ +Documentation is available online: https://pymysql.readthedocs.io/ For support, please refer to the `StackOverflow `_. diff --git a/pymysql/connections.py b/pymysql/connections.py index 31dd85a..c6de9a2 100644 --- a/pymysql/connections.py +++ b/pymysql/connections.py @@ -55,28 +55,6 @@ def _makefile(sock, mode): return io.BufferedReader(SocketIO(sock, mode)) -elif _py_version == (2, 6): - # Python 2.6 doesn't have fast io module. - # So we make original one. - class SockFile(object): - def __init__(self, sock): - self._sock = sock - - def read(self, n): - read = self._sock.recv(n) - if len(read) == n: - return read - while True: - data = self._sock.recv(n-len(read)) - if not data: - return read - read += data - if len(read) == n: - return read - - def _makefile(sock, mode): - assert mode == 'rb' - return SockFile(sock) else: # socket.makefile in Python 3 is nice. def _makefile(sock, mode): diff --git a/setup.py b/setup.py index b07fde3..9c78a23 100755 --- a/setup.py +++ b/setup.py @@ -24,8 +24,9 @@ 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Intended Audience :: Developers',