Skip to content

Commit

Permalink
Merge pull request #56 from singingwolfboy/pkg_resources-parse_version
Browse files Browse the repository at this point in the history
`pkg_resources.parse_version()` instead of `distutils.StrictVersion`
  • Loading branch information
singingwolfboy committed May 18, 2016
2 parents 8225fc1 + a59db33 commit 85c97c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions flask_dance/consumer/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import six
from lazy import lazy
from abc import ABCMeta, abstractmethod, abstractproperty
from distutils.version import StrictVersion
from werkzeug.datastructures import CallbackDict
import flask
from flask.signals import Namespace
Expand Down Expand Up @@ -33,8 +32,9 @@ def __init__(self, name, import_name,
url_defaults=url_defaults,
root_path=root_path,
)
# `root_path` didn't exist until 1.0
if StrictVersion(flask.__version__) < StrictVersion('1.0'):
# `root_path` didn't exist in 0.10, and will cause an error if it's
# passed in that version. Only pass `root_path` if it's set.
if bp_kwargs["root_path"] is None:
del bp_kwargs["root_path"]
flask.Blueprint.__init__(self, **bp_kwargs)

Expand Down
4 changes: 2 additions & 2 deletions tests/consumer/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

import pytest
import mock
from distutils.version import StrictVersion
from pkg_resources import parse_version
import requests_oauthlib
from flask_dance.consumer.requests import OAuth1Session, OAuth2Session

requires_requests_oauthlib_05 = pytest.mark.skipif(
StrictVersion(requests_oauthlib.__version__) < StrictVersion('0.5'),
parse_version(requests_oauthlib.__version__) < parse_version('0.5'),
reason="requires requests_oauthlib at version 0.5 or higher",
)

Expand Down

0 comments on commit 85c97c5

Please sign in to comment.