Gentoo Archives: gentoo-commits

From: Andrey Grozin <grozin@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/colorama/files/, dev-python/colorama/
Date: Tue, 23 Feb 2016 13:16:16
Message-Id: 1456232727.a625adf7fef166089c66cb045cd026b1e9ceb7aa.grozin@gentoo
1 commit: a625adf7fef166089c66cb045cd026b1e9ceb7aa
2 Author: Andrey Grozin <grozin <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 23 13:05:27 2016 +0000
4 Commit: Andrey Grozin <grozin <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 23 13:05:27 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a625adf7
7
8 dev-python/colorama: upstream fix
9
10 https://github.com/tartley/colorama/commit/1244a00ae1accfeca3b4b1a85a3b718a920dd6bd
11
12 Package-Manager: portage-2.2.27
13
14 dev-python/colorama/colorama-0.3.6.ebuild | 4 +++-
15 dev-python/colorama/files/colorama-0.3.6.patch | 32 ++++++++++++++++++++++++++
16 2 files changed, 35 insertions(+), 1 deletion(-)
17
18 diff --git a/dev-python/colorama/colorama-0.3.6.ebuild b/dev-python/colorama/colorama-0.3.6.ebuild
19 index ae0dd99..7cc8884 100644
20 --- a/dev-python/colorama/colorama-0.3.6.ebuild
21 +++ b/dev-python/colorama/colorama-0.3.6.ebuild
22 @@ -2,7 +2,7 @@
23 # Distributed under the terms of the GNU General Public License v2
24 # $Id$
25
26 -EAPI=5
27 +EAPI=6
28
29 PYTHON_COMPAT=( python2_7 python3_{3,4,5} pypy pypy3 )
30
31 @@ -19,6 +19,8 @@ SLOT="0"
32 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
33 IUSE="examples"
34
35 +PATCHES=( "${FILESDIR}"/${P}.patch )
36 +
37 python_install_all() {
38 use examples && local EXAMPLES=( demos/. )
39 distutils-r1_python_install_all
40
41 diff --git a/dev-python/colorama/files/colorama-0.3.6.patch b/dev-python/colorama/files/colorama-0.3.6.patch
42 new file mode 100644
43 index 0000000..65a9476
44 --- /dev/null
45 +++ b/dev-python/colorama/files/colorama-0.3.6.patch
46 @@ -0,0 +1,32 @@
47 +diff -r -U2 colorama-0.3.6.orig/colorama/ansitowin32.py colorama-0.3.6/colorama/ansitowin32.py
48 +--- colorama-0.3.6.orig/colorama/ansitowin32.py 2015-12-14 09:09:52.000000000 +0100
49 ++++ colorama-0.3.6/colorama/ansitowin32.py 2016-02-23 13:52:37.230415139 +0100
50 +@@ -14,4 +14,8 @@
51 +
52 +
53 ++def is_stream_closed(stream):
54 ++ return not hasattr(stream, 'closed') or stream.closed
55 ++
56 ++
57 + def is_a_tty(stream):
58 + return hasattr(stream, 'isatty') and stream.isatty()
59 +@@ -65,10 +69,10 @@
60 + # should we strip ANSI sequences from our output?
61 + if strip is None:
62 +- strip = conversion_supported or (not wrapped.closed and not is_a_tty(wrapped))
63 ++ strip = conversion_supported or (not is_stream_closed(wrapped) and not is_a_tty(wrapped))
64 + self.strip = strip
65 +
66 + # should we should convert ANSI sequences into win32 calls?
67 + if convert is None:
68 +- convert = conversion_supported and not wrapped.closed and is_a_tty(wrapped)
69 ++ convert = conversion_supported and not is_stream_closed(wrapped) and is_a_tty(wrapped)
70 + self.convert = convert
71 +
72 +@@ -146,5 +150,5 @@
73 + if self.convert:
74 + self.call_win32('m', (0,))
75 +- elif not self.strip and not self.wrapped.closed:
76 ++ elif not self.strip and not is_stream_closed(self.wrapped):
77 + self.wrapped.write(Style.RESET_ALL)
78 +