From a04bc6f45d84b1f2de97fc9cc68e54511d78028a Mon Sep 17 00:00:00 2001 From: Elvish_Hunter Date: Tue, 22 Sep 2015 23:13:44 +0200 Subject: [PATCH] Converted wmllint to Python 3 Please note that attempting to run wmllint on Python 3.4 leads to an exception after finishing the spellcheck. This is a known bug in PyEnchant 1.6.5, and it can be solved by using PyEnchant 1.6.6. See https://github.com/rfk/pyenchant/issues/34 . --- data/tools/wmllint | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/data/tools/wmllint b/data/tools/wmllint index 7cc138b2eca..b1ff4c188b5 100755 --- a/data/tools/wmllint +++ b/data/tools/wmllint @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # wmllint -- check WML for conformance to the most recent dialect @@ -181,14 +181,9 @@ # code. # -from __future__ import print_function, unicode_literals, division -from future_builtins import filter, map, zip -input = raw_input -range = xrange - import sys, os, re, getopt, string, copy, difflib, time, gzip, codecs -from wesnoth.wmltools import * -from wesnoth.wmliterator import * +from wesnoth.wmltools3 import * +from wesnoth.wmliterator3 import * # Changes meant to be done on maps and .cfg lines. mapchanges = ( @@ -2931,7 +2926,7 @@ In your case, your system interprets your arguments as: except: print("wmllint: internal error on %s" % fn, file=sys.stderr) (exc_type, exc_value, exc_traceback) = sys.exc_info() - raise exc_type, exc_value, exc_traceback + raise exc_type(exc_value).with_traceback(exc_traceback) if not clean and not diffs and not revert: # Consistency-check everything we got from the file scans if not inconsistency: