diff --git a/tailbone/views/upgrades.py b/tailbone/views/upgrades.py index 8c7b1216..2a37709b 100644 --- a/tailbone/views/upgrades.py +++ b/tailbone/views/upgrades.py @@ -2,7 +2,7 @@ ################################################################################ # # Rattail -- Retail Software Framework -# Copyright © 2010-2019 Lance Edgar +# Copyright © 2010-2020 Lance Edgar # # This file is part of Rattail. # @@ -35,13 +35,18 @@ from sqlalchemy import orm # TODO: pip has declared these to be "not public API" so we should find another way.. try: - # this works for now, with pip 10.0.1 - from pip._internal.download import PipSession + # this works for now, with pip 20.0 + from pip._internal.network.session import PipSession from pip._internal.req import parse_requirements except ImportError: - # this should work with pip < 10.0 - from pip.download import PipSession - from pip.req import parse_requirements + try: + # this works for now, with pip 10.0.1 + from pip._internal.download import PipSession + from pip._internal.req import parse_requirements + except ImportError: + # this should work with pip < 10.0 + from pip.download import PipSession + from pip.req import parse_requirements from rattail.db import model, Session as RattailSession from rattail.time import make_utc