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 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')