Skip to content

Commit

Permalink
Fixed a type check which was causing syntax/undefined errors in
Browse files Browse the repository at this point in the history
DenyHosts/report.py when switching between Python2 and Python3.
  • Loading branch information
slicer69 committed Jun 27, 2015
1 parent dbfa818 commit b5611df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
DENYHOSTS CHANGELOG

3.1
======================

Fixed a type check in DenyHosts/report.py which was causing
problems when moving between Python2 and Python3.



3.0
======================

Expand Down
4 changes: 3 additions & 1 deletion DenyHosts/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import socket
# Removing this as it causes runtime errors on Python3.4
# from types import ListType, TupleType
import types
from .util import is_true
try:
import syslog
Expand Down Expand Up @@ -38,7 +39,8 @@ def get_report(self):
def add_section(self, message, iterable):
self.report += "%s:\n\n" % message
for i in iterable:
if type(i) in (TupleType, ListType):
# if type(i) in (TupleType, ListType):
if (type(i) is types.ListType) or (type(i) is types.TupleType):
extra = ": %d\n" % i[1]
i = i[0]
else:
Expand Down

0 comments on commit b5611df

Please sign in to comment.