Skip to content

Commit

Permalink
Test: CTS: Version independant check for a string type
Browse files Browse the repository at this point in the history
  • Loading branch information
beekhof committed Jul 30, 2015
1 parent eea2ac6 commit 537df3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cts/logging.py
Expand Up @@ -22,7 +22,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.

import types, string, sys, time, os
import string, sys, time, os

class Logger:
TimeFormat = "%b %d %H:%M:%S\t"
Expand All @@ -47,7 +47,7 @@ def __init__(self, filename, tag):

def __call__(self, lines):
t = time.strftime(Logger.TimeFormat, time.localtime(time.time()))
if isinstance(lines, types.StringType):
if isinstance(lines, basestring):
sys.__stderr__.writelines([t, lines, "\n"])
else:
for line in lines:
Expand All @@ -71,7 +71,7 @@ def __call__(self, lines):
fd = open(self.logfile, "a")
t = time.strftime(Logger.TimeFormat, time.localtime(time.time()))

if isinstance(lines, types.StringType):
if isinstance(lines, basestring):
fd.writelines([t, self.hostname, self.source, lines, "\n"])
else:
for line in lines:
Expand Down

0 comments on commit 537df3c

Please sign in to comment.