Closed ltaulell closed 2 months ago
Just for the brain: deal with it.
import platform print(platform.python_version())
How dumb am I?
"if int(python_version())", please.
less dumb, using:
from platform import python_version
from packaging.version import Version
then:
if Version(python_version()) >= Version('3.9'):
changes between python3.7 and python3.9/3.11 make load/save processing variable depending on python/shelve versions.
python3.7 (main.py): def load_game(): """ load saved game """ global univers, planetes, captain, fname try: fname = sg.popup_get_file('Saved game to open', default_extension='.db', file_types=(('saved game(s)', '.db'), ('all files', '.*')), ).replace('.db', '') except AttributeError: pass
python3.9/3.11 (main.py): def load_game(): """ load saved game """ global univers, planetes, captain, fname try: fname = sg.popup_get_file('Saved game to open', default_extension='.db', file_types=(('saved game(s)', '.db'), ('all files', '.*')), ) # .replace('.db', '') except AttributeError: pass
same for save()/save_as(). Deal with it or impose a minimal version for python? (as 3.7 is already deprecated)