From 3de5df390e813150d28ca2f692a8d952c9152279 Mon Sep 17 00:00:00 2001 From: Phil Chennikkara Date: Mon, 1 Jun 2020 19:39:39 -0500 Subject: [PATCH 1/2] Fix bug where _isatty doesn't work on fileno() --- news/4305.bugfix.rst | 1 + pipenv/environments.py | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) create mode 100644 news/4305.bugfix.rst diff --git a/news/4305.bugfix.rst b/news/4305.bugfix.rst new file mode 100644 index 00000000..70ab419f --- /dev/null +++ b/news/4305.bugfix.rst @@ -0,0 +1 @@ +Fix a bug where Pipenv doesn't realize the session is interactive diff --git a/pipenv/environments.py b/pipenv/environments.py index b9d89806..005d0a2d 100644 --- a/pipenv/environments.py +++ b/pipenv/environments.py @@ -341,11 +341,7 @@ PIPENV_SHELL = ( ) # Internal, to tell whether the command line session is interactive. -try: - SESSION_IS_INTERACTIVE = _isatty(sys.stdout.fileno()) -except UnsupportedOperation: - SESSION_IS_INTERACTIVE = _isatty(sys.stdout) - +SESSION_IS_INTERACTIVE = _isatty(sys.stdout) # Internal, consolidated verbosity representation as an integer. The default # level is 0, increased for wordiness and decreased for terseness. From 1689485de13663b85a553573eb67729433559ad7 Mon Sep 17 00:00:00 2001 From: Phil Chennikkara Date: Mon, 1 Jun 2020 19:43:33 -0500 Subject: [PATCH 2/2] Print installer class name instead of object reference --- news/4305.trivial.rst | 1 + pipenv/installers.py | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 news/4305.trivial.rst diff --git a/news/4305.trivial.rst b/news/4305.trivial.rst new file mode 100644 index 00000000..17d38128 --- /dev/null +++ b/news/4305.trivial.rst @@ -0,0 +1 @@ +Print class name instead of the object reference when using installer to install a python version diff --git a/pipenv/installers.py b/pipenv/installers.py index 18abdd74..1e81047d 100644 --- a/pipenv/installers.py +++ b/pipenv/installers.py @@ -71,6 +71,9 @@ class Installer(object): self.cmd = self._find_installer() super(Installer, self).__init__() + def __str__(self): + return self.__class__.__name__ + @abstractmethod def _find_installer(self): pass