Skip to content

Commit 92d59b7

Browse files
authored
Correct version comparison code
1 parent d6011e9 commit 92d59b7

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

wntr/epanet/msx/toolkit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import sys
1717
from typing import Union
1818

19-
if sys.version_info <= (3, 11):
19+
if sys.version_info[0:2] <= (3, 11):
2020
from pkg_resources import resource_filename
2121
else:
2222
from importlib.resources import files
@@ -49,7 +49,7 @@ def __init__(self, inpfile="", rptfile="", binfile="", msxfile=""):
4949
self.msxfile = msxfile
5050

5151
try:
52-
if sys.version_info <= (3, 11):
52+
if sys.version_info[0:2] <= (3, 11):
5353

5454
if os.name in ["nt", "dos"]:
5555
libepanet = resource_filename(__name__, "../libepanet/windows-x64/epanet2.dll")

wntr/epanet/toolkit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import sys
1111
from ctypes import byref
1212

13-
if sys.version_info <= (3, 11):
13+
if sys.version_info[0:2] <= (3, 11):
1414
from pkg_resources import resource_filename
1515
else:
1616
from importlib.resources import files
@@ -108,7 +108,7 @@ def __init__(self, inpfile="", rptfile="", binfile="", version=2.2):
108108
self.binfile = binfile
109109

110110
try:
111-
if sys.version_info <= (3, 11):
111+
if sys.version_info[0:2] <= (3, 11):
112112
if float(version) == 2.0:
113113
libname = libepanet.replace('epanet22.','epanet20.')
114114
if 'arm' in platform.platform():

wntr/library/msx/_msxlibrary.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import os, sys
2222
from typing import Any, ItemsView, Iterator, KeysView, List, Tuple, Union, ValuesView
2323

24-
if sys.version_info <= (3, 11):
24+
if sys.version_info[0:2] <= (3, 11):
2525
from pkg_resources import resource_filename
2626
else:
2727
from importlib.resources import files
@@ -102,7 +102,7 @@ def __init__(self, extra_paths: List[str] = None, include_builtins=True,
102102
self.__data = dict()
103103

104104
if include_builtins:
105-
if sys.version_info <= (3, 11):
105+
if sys.version_info[0:2] <= (3, 11):
106106
default_path = os.path.abspath(resource_filename(__name__, '.'))
107107
else:
108108
default_path = os.path.abspath(files('wntr.library.msx').joinpath('.'))

0 commit comments

Comments
 (0)