diff options
author | 2015-12-20 23:15:25 +0100 | |
---|---|---|
committer | 2015-12-22 08:33:26 +0100 | |
commit | a19acb722825e935716ba8cdb7b914ed9f93b899 (patch) | |
tree | 428f740f92c11f0bbf93a705ad1594615ac0e8fc /dev-python/yapps/files | |
parent | sys-auth/consolekit: herd->maintainer (diff) | |
download | gentoo-a19acb722825e935716ba8cdb7b914ed9f93b899.tar.gz gentoo-a19acb722825e935716ba8cdb7b914ed9f93b899.tar.bz2 gentoo-a19acb722825e935716ba8cdb7b914ed9f93b899.zip |
dev-python/yapps: Add patches to fix python3 support
Grabbed from https://github.com/smurfix/yapps/pull/2
Package-Manager: portage-2.2.26
Diffstat (limited to 'dev-python/yapps/files')
-rw-r--r-- | dev-python/yapps/files/yapps-Convert-print-statements-to-python3-style-print-func.patch | 46 | ||||
-rw-r--r-- | dev-python/yapps/files/yapps-Don-t-capture-sys.stderr-at-import-time.patch | 32 |
2 files changed, 78 insertions, 0 deletions
diff --git a/dev-python/yapps/files/yapps-Convert-print-statements-to-python3-style-print-func.patch b/dev-python/yapps/files/yapps-Convert-print-statements-to-python3-style-print-func.patch new file mode 100644 index 000000000000..4bff7f8f40dd --- /dev/null +++ b/dev-python/yapps/files/yapps-Convert-print-statements-to-python3-style-print-func.patch @@ -0,0 +1,46 @@ +From d051588873a54860cfb86ec0d330f7d855336618 Mon Sep 17 00:00:00 2001 +From: Julien Cristau <julien.cristau@logilab.fr> +Date: Tue, 2 Dec 2014 10:41:05 +0100 +Subject: [PATCH 2/2] Convert print statements to python3-style print function + +Signed-off-by: Julien Cristau <julien.cristau@logilab.fr> +--- + yapps/runtime.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/yapps/runtime.py b/yapps/runtime.py +index 58017fe..5d40581 100644 +--- a/yapps/runtime.py ++++ b/yapps/runtime.py +@@ -178,7 +178,7 @@ class Scanner(object): + file,line,p = pos + if file != self.filename: + if self.stack: return self.stack.print_line_with_pointer(pos,length=length,out=out) +- print >>out, "(%s: not in input buffer)" % file ++ print("(%s: not in input buffer)" % file, file=out) + return + + text = self.input +@@ -201,7 +201,7 @@ class Scanner(object): + break + spos = cr+1 + else: +- print >>out, "(%s:%d not in input buffer)" % (file,origline) ++ print("(%s:%d not in input buffer)" % (file,origline), file=out) + return + + # Now try printing part of the line +@@ -230,8 +230,8 @@ class Scanner(object): + p = p - 7 + + # Now print the string, along with an indicator +- print >>out, '> ',text +- print >>out, '> ',' '*p + '^' ++ print('> ',text, file=out) ++ print('> ',' '*p + '^', file=out) + + def grab_input(self): + """Get more input if possible.""" +-- +2.6.4 + diff --git a/dev-python/yapps/files/yapps-Don-t-capture-sys.stderr-at-import-time.patch b/dev-python/yapps/files/yapps-Don-t-capture-sys.stderr-at-import-time.patch new file mode 100644 index 000000000000..1e25a0059409 --- /dev/null +++ b/dev-python/yapps/files/yapps-Don-t-capture-sys.stderr-at-import-time.patch @@ -0,0 +1,32 @@ +From 482faec17f1c69784d8cc2757a79809458d71154 Mon Sep 17 00:00:00 2001 +From: Julien Cristau <julien.cristau@logilab.fr> +Date: Tue, 2 Dec 2014 10:40:01 +0100 +Subject: [PATCH 1/2] Don't capture sys.stderr at import time + +Signed-off-by: Julien Cristau <julien.cristau@logilab.fr> +--- + yapps/runtime.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/yapps/runtime.py b/yapps/runtime.py +index 29f91e7..58017fe 100644 +--- a/yapps/runtime.py ++++ b/yapps/runtime.py +@@ -168,10 +168,13 @@ class Scanner(object): + # output += '%s\n' % (repr(t),) + # return output + +- def print_line_with_pointer(self, pos, length=0, out=sys.stderr): ++ def print_line_with_pointer(self, pos, length=0, out=None): + """Print the line of 'text' that includes position 'p', + along with a second line with a single caret (^) at position p""" + ++ if out is None: ++ out = sys.stderr ++ + file,line,p = pos + if file != self.filename: + if self.stack: return self.stack.print_line_with_pointer(pos,length=length,out=out) +-- +2.6.4 + |