Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deprecation warning for 3.5 and lower #783

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change from print to warnings
Cobalt authored May 28, 2021
commit 7b3464bba6af00ab7e9bdd244cae5648a0706aa1
8 changes: 5 additions & 3 deletions src/gino/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import sys
import warnings

from .api import Gino # NOQA
from .bakery import Bakery
@@ -44,13 +45,14 @@ def get_version():

# Check if current python version is deprecated
try:
# Get version from sys.vrsion value (usually: '3.7.0 ...')
# Get version from sys.version value (usually: '3.7.0 ...')
subversion = int(sys.version[2])

# Check if version is lower than 3.6
if subversion < 6:
print(
"DEPRECATION WARNING: Python version 3.5 and lower are not supported since they've reached EOL"
warnings.warn(
"DEPRECATION WARNING: Python version 3.5 and lower are not supported",
DeprecationWarning,
)
except ValueError:
# Unable to determine version leads to warning