Fix python3 issues

This commit is contained in:
Stefan Klug 2015-10-28 21:20:16 +01:00
parent d93f8ce937
commit 0d405cc8d4
4 changed files with 8 additions and 7 deletions

View file

@ -704,7 +704,7 @@ class MemoryBuffer(Buffer):
res, escape = evalEntry.evaluate(context) res, escape = evalEntry.evaluate(context)
if escape: result.dumpContent(res) if escape: result.dumpContent(res)
else: result.write(res) else: result.write(res)
except EvaluationError, e: except EvaluationError as e:
# This exception has already been treated (see the # This exception has already been treated (see the
# "except" block below). Simply re-raise it when needed. # "except" block below). Simply re-raise it when needed.
if self.env.raiseOnError: raise e if self.env.raiseOnError: raise e

View file

@ -1,7 +1,7 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
import os, re, http.client, sys, stat, urllib.parse, time, socket, xml.sax import os, re, http.client, sys, stat, urllib.parse, time, socket, xml.sax
from urllib.parse import quote from urllib.parse import quote
from StringIO import StringIO from io import StringIO
from mimetypes import guess_type from mimetypes import guess_type
from base64 import encodestring from base64 import encodestring
from appy import Object from appy import Object

View file

@ -25,7 +25,8 @@
be strictly greater than 1.''' be strictly greater than 1.'''
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
import re, sys, collections, UserDict import re, sys, collections
from collections import UserDict
from io import StringIO from io import StringIO
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@ -203,9 +204,9 @@ class Table(collections.UserList):
return infoDict return infoDict
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
class TableRow(UserDict.UserDict): class TableRow(UserDict):
def __init__(self, table): def __init__(self, table):
UserDict.UserDict.__init__(self) UserDict.__init__(self)
self.table = table self.table = table
def __getitem__(self, key): def __getitem__(self, key):
'''This method "implements" row inheritance: if the current row does '''This method "implements" row inheritance: if the current row does
@ -214,7 +215,7 @@ class TableRow(UserDict.UserDict):
keyError = False keyError = False
t = self.table t = self.table
if key in self: if key in self:
res = UserDict.UserDict.__getitem__(self, key) res = UserDict.__getitem__(self, key)
else: else:
# Get the parent row # Get the parent row
if t.parent: if t.parent:

View file

@ -542,7 +542,7 @@ class LinesCounter:
if analyser.numberOfFiles: if analyser.numberOfFiles:
analyser.printReport() analyser.printReport()
total += analyser.numberOfLines() total += analyser.numberOfLines()
print 'Total (including commented and blank): ***', total, '***' print('Total (including commented and blank): ***', total, '***')
def isExcluded(self, path): def isExcluded(self, path):
'''Must p_path be excluded from the analysis?''' '''Must p_path be excluded from the analysis?'''