Skip to content

Commit

Permalink
fix(flask): Warning __version__ is deprecated, will be removed in 3.1
Browse files Browse the repository at this point in the history
Signed-off-by: Ferenc Géczi <ferenc.geczi@ibm.com>
  • Loading branch information
Ferenc- committed Oct 2, 2023
1 parent 1eb9a77 commit 3436e1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions instana/instrumentation/flask/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
#
# Blinker support is preferred but we do the best we can when it's not available.
#
flask_version = tuple(map(int, flask.__version__.split('.')))
if flask_version < (2, 3, 0):
if hasattr(flask.signals, 'signals_available'):
from flask.signals import signals_available
else:
# Beginning from 2.3.0 as stated in the notes
Expand Down
5 changes: 2 additions & 3 deletions tests/frameworks/test_flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
import sys
import unittest
import urllib3

import flask
flask_version = tuple(map(int, flask.__version__.split('.')))
if flask_version < (2, 3, 0):

if hasattr(flask.signals, 'signals_available'):
from flask.signals import signals_available
else:
# Beginning from 2.3.0 as stated in the notes
Expand Down

0 comments on commit 3436e1d

Please sign in to comment.