mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 06:46:15 +00:00
Switch to using pathlib2 for python<3.5
- Fixes #2438 Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Pipenv will now always use ``pathlib2`` for ``Path`` based filesystem interactions by default on ``python<3.5``.
|
||||
+7
-4
@@ -29,10 +29,13 @@ except ImportError:
|
||||
_types.add(type(arg))
|
||||
return _types.pop()
|
||||
|
||||
try:
|
||||
from pathlib import Path
|
||||
except ImportError:
|
||||
from pathlib2 import Path
|
||||
if sys.version_info[:2] >= (3, 5):
|
||||
try:
|
||||
from pathlib import Path
|
||||
except ImportError:
|
||||
from .vendor.pathlib2 import Path
|
||||
else:
|
||||
from .vendor.pathlib2 import Path
|
||||
|
||||
|
||||
try:
|
||||
|
||||
+1
-4
@@ -14,10 +14,7 @@ import six
|
||||
import toml
|
||||
import json as simplejson
|
||||
|
||||
try:
|
||||
from pathlib import Path
|
||||
except ImportError:
|
||||
from pathlib2 import Path
|
||||
from ._compat import Path
|
||||
|
||||
from .cmdparse import Script
|
||||
from .vendor.requirementslib import Requirement
|
||||
|
||||
+2
-8
@@ -36,13 +36,7 @@ try:
|
||||
from urllib.parse import urlparse
|
||||
except ImportError:
|
||||
from urlparse import urlparse
|
||||
try:
|
||||
from pathlib import Path
|
||||
except ImportError:
|
||||
try:
|
||||
from .vendor.pathlib2 import Path
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
from distutils.spawn import find_executable
|
||||
from contextlib import contextmanager
|
||||
from .pep508checker import lookup
|
||||
@@ -231,7 +225,7 @@ def actually_resolve_deps(
|
||||
from pipenv.patched.piptools.scripts.compile import get_pip_command
|
||||
from pipenv.patched.piptools import logging as piptools_logging
|
||||
from pipenv.patched.piptools.exceptions import NoCandidateFound
|
||||
from ._compat import TemporaryDirectory, NamedTemporaryFile
|
||||
from ._compat import TemporaryDirectory, NamedTemporaryFile, Path
|
||||
|
||||
class PipCommand(basecommand.Command):
|
||||
"""Needed for pip-tools."""
|
||||
|
||||
Reference in New Issue
Block a user