From 6132bc8ac5c9381c3d1e13153411e2da48bbe586 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Sun, 3 Jan 2021 14:01:30 +0900 Subject: [PATCH 1/4] remove util.py --- pymysql/connections.py | 7 +++---- pymysql/protocol.py | 9 +++------ pymysql/tests/test_basic.py | 2 +- pymysql/util.py | 12 ------------ 4 files changed, 7 insertions(+), 23 deletions(-) delete mode 100644 pymysql/util.py diff --git a/pymysql/connections.py b/pymysql/connections.py index 32bf509b..63a8b3a9 100644 --- a/pymysql/connections.py +++ b/pymysql/connections.py @@ -25,7 +25,6 @@ EOFPacketWrapper, LoadLocalPacketWrapper, ) -from .util import byte2int, int2byte from . import err, VERSION_STRING try: @@ -76,7 +75,7 @@ def _lenenc_int(i): "Encoding %d is less than 0 - no representation in LengthEncodedInteger" % i ) elif i < 0xFB: - return int2byte(i) + return bytes([i]) elif i < (1 << 16): return b"\xfc" + struct.pack(" Date: Sun, 3 Jan 2021 14:03:39 +0900 Subject: [PATCH 2/4] black --- pymysql/tests/test_basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymysql/tests/test_basic.py b/pymysql/tests/test_basic.py index 0e817832..133aed23 100644 --- a/pymysql/tests/test_basic.py +++ b/pymysql/tests/test_basic.py @@ -44,7 +44,7 @@ def test_datatypes(self): ) c.execute("select b,i,l,f,s,u,bb,d,dt,td,t,st from test_datatypes") r = c.fetchone() - self.assertEqual(b'\x01', r[0]) + self.assertEqual(b"\x01", r[0]) self.assertEqual(v[1:10], r[1:10]) self.assertEqual( datetime.timedelta(0, 60 * (v[10].hour * 60 + v[10].minute)), r[10] From 64d5b7f56b6fa5f3c3f5a0af08114e7b40dc4c28 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Sun, 3 Jan 2021 14:09:49 +0900 Subject: [PATCH 3/4] fix --- pymysql/tests/test_basic.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pymysql/tests/test_basic.py b/pymysql/tests/test_basic.py index 133aed23..fc195312 100644 --- a/pymysql/tests/test_basic.py +++ b/pymysql/tests/test_basic.py @@ -4,7 +4,6 @@ import pytest -from pymysql import util import pymysql.cursors from pymysql.tests import base from pymysql.err import ProgrammingError From 768945e6f6cfa9c8a5d5f3e5a694b3481675d0ab Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Sun, 3 Jan 2021 14:17:10 +0900 Subject: [PATCH 4/4] fix --- pymysql/tests/test_nextset.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pymysql/tests/test_nextset.py b/pymysql/tests/test_nextset.py index 2679edd5..28972325 100644 --- a/pymysql/tests/test_nextset.py +++ b/pymysql/tests/test_nextset.py @@ -1,7 +1,6 @@ import pytest import pymysql -from pymysql import util from pymysql.tests import base from pymysql.constants import CLIENT