From a9169c157a05c82a1b8a7ffb92e7f159fb4ca0f8 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 18 Jan 2014 13:25:15 +0100 Subject: futurizing: move to print_function and "except X as Y" syntax --- scripts/vim2pygments.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts/vim2pygments.py') diff --git a/scripts/vim2pygments.py b/scripts/vim2pygments.py index 80f0ada2..6c33a36c 100644 --- a/scripts/vim2pygments.py +++ b/scripts/vim2pygments.py @@ -10,6 +10,7 @@ :copyright 2006 by Armin Ronacher. :license: BSD, see LICENSE for details. """ +from __future__ import print_function import sys import re @@ -916,14 +917,14 @@ def convert(filename, stream=None): def main(): if len(sys.argv) != 2 or sys.argv[1] in ('-h', '--help'): - print 'Usage: %s ' % sys.argv[0] + print('Usage: %s ' % sys.argv[0]) return 2 if sys.argv[1] in ('-v', '--version'): - print '%s %s' % (SCRIPT_NAME, SCRIPT_VERSION) + print('%s %s' % (SCRIPT_NAME, SCRIPT_VERSION)) return filename = sys.argv[1] if not (path.exists(filename) and path.isfile(filename)): - print 'Error: %s not found' % filename + print('Error: %s not found' % filename) return 1 convert(filename, sys.stdout) sys.stdout.write('\n') -- cgit v1.2.1 From b6b690fb833e7031a3008509c1107f7567c065f3 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 18 Jan 2014 13:29:19 +0100 Subject: manual prettifying and small fixes after futurize run --- scripts/vim2pygments.py | 1 + 1 file changed, 1 insertion(+) mode change 100644 => 100755 scripts/vim2pygments.py (limited to 'scripts/vim2pygments.py') diff --git a/scripts/vim2pygments.py b/scripts/vim2pygments.py old mode 100644 new mode 100755 index 6c33a36c..348fb852 --- a/scripts/vim2pygments.py +++ b/scripts/vim2pygments.py @@ -10,6 +10,7 @@ :copyright 2006 by Armin Ronacher. :license: BSD, see LICENSE for details. """ + from __future__ import print_function import sys -- cgit v1.2.1 From 97703d63f39e6086d497a6a749c9eee3293dcbeb Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 18 Jan 2014 16:44:49 +0100 Subject: Finalize single-source port for Py2.[67] and Py3.3+. --- scripts/vim2pygments.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/vim2pygments.py') diff --git a/scripts/vim2pygments.py b/scripts/vim2pygments.py index 348fb852..42af0bbe 100755 --- a/scripts/vim2pygments.py +++ b/scripts/vim2pygments.py @@ -16,7 +16,7 @@ from __future__ import print_function import sys import re from os import path -from cStringIO import StringIO +from io import StringIO split_re = re.compile(r'(?