From 6ce3f0027276eb513a49800313ca57dec7254671 Mon Sep 17 00:00:00 2001 From: Jayson Reis Date: Wed, 8 Jan 2025 22:12:50 +0100 Subject: [PATCH 1/2] Remove python2 runner --- .github/workflows/tests-and-lint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests-and-lint.yml b/.github/workflows/tests-and-lint.yml index b513035..39bd99c 100644 --- a/.github/workflows/tests-and-lint.yml +++ b/.github/workflows/tests-and-lint.yml @@ -12,12 +12,12 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [2.7, 3.7, 3.8, 3.9, "3.10", 3.11] + python-version: [3.7, 3.8, 3.9, "3.10", 3.11] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: LizardByte/setup-python-action@v2024.919.163656 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Dependencies From 735de771edd93ff994e5d44c07041263d3d65bbd Mon Sep 17 00:00:00 2001 From: Jayson Reis Date: Wed, 8 Jan 2025 22:15:30 +0100 Subject: [PATCH 2/2] Lint fixes --- bmemcached/protocol.py | 2 +- test/test_server_parsing.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bmemcached/protocol.py b/bmemcached/protocol.py index 1f27b21..06d7cb3 100644 --- a/bmemcached/protocol.py +++ b/bmemcached/protocol.py @@ -195,7 +195,7 @@ def is_ip_address(address): return True except ValueError: return False - + if is_ip_address(server): return server, default_port diff --git a/test/test_server_parsing.py b/test/test_server_parsing.py index bd3b368..50e18bd 100644 --- a/test/test_server_parsing.py +++ b/test/test_server_parsing.py @@ -39,9 +39,9 @@ def testIPv6(self): server = bmemcached.protocol.Protocol('2001:db8::2') self.assertEqual(server.host, '2001:db8::2') self.assertEqual(server.port, 11211) - # Since `2001:db8::2:8080` is a valid IPv6 address, + # Since `2001:db8::2:8080` is a valid IPv6 address, # it is ambiguous whether to split it into `2001:db8::2` and `8080` - # or treat it as `2001:db8::2:8080`. + # or treat it as `2001:db8::2:8080`. # Therefore, it will be treated as `2001:db8::2:8080`. server = bmemcached.protocol.Protocol('2001:db8::2:8080') self.assertEqual(server.host, '2001:db8::2:8080')