Skip to content

Commit

Permalink
Replace basestring with six.string_types
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemacfarlane committed Oct 11, 2014
1 parent 2938ebe commit 4f6f684
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/z3c/rml/paraparser.py
Expand Up @@ -15,6 +15,7 @@
"""
import copy
import inspect
import six

import reportlab.lib.fonts
import reportlab.platypus.paraparser
Expand Down Expand Up @@ -86,7 +87,7 @@ def __init__(self, **attributes):
def text(self):
text = u''
for frag in self.frags:
if isinstance(frag, basestring):
if isinstance(frag, six.string_types):
text += frag
else:
text += frag.text
Expand Down
3 changes: 2 additions & 1 deletion src/z3c/rml/template.py
Expand Up @@ -13,6 +13,7 @@
##############################################################################
"""Style Related Element Processing
"""
import six
import zope.interface
from reportlab import platypus
from z3c.rml import attr, directive, interfaces, occurence
Expand Down Expand Up @@ -122,7 +123,7 @@ def process(self):
args = dict(self.getAttributeValues())
# Deal with percentages
for name, dir in (('x1', 0), ('y1', 1), ('width', 0), ('height', 1)):
if isinstance(args[name], basestring) and args[name].endswith('%'):
if isinstance(args[name], six.string_types) and args[name].endswith('%'):
args[name] = float(args[name][:-1])/100*size[dir]
frame = platypus.Frame(**args)
self.parent.frames.append(frame)
Expand Down

0 comments on commit 4f6f684

Please sign in to comment.