Skip to content

Commit 0f675e1

Browse files
committed
fix old python versions
1 parent 9436eca commit 0f675e1

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.vscode/
2-
venv/
2+
venv*/
33
testdir/
44
testdir_persistent/
55
__pycache__/

mcserverwrapper/src/util/info_getter.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22

33
from __future__ import annotations
44

5+
import sys
6+
57
from mcstatus import JavaServer
6-
from mcstatus.responses import JavaStatusResponse
8+
9+
# python versions above 3.9
10+
if sys.version_info.minor > 9:
11+
from mcstatus.responses import JavaStatusResponse
12+
else:
13+
from mcstatus.status_response import JavaStatusResponse
714

815
def ping_address_with_return(address, port, timeout=3) -> JavaStatusResponse | None:
916
"""Pings a given address/port combination and returns the result or None"""

0 commit comments

Comments
 (0)