Skip to content

Commit

Permalink
Fix Python 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemacfarlane committed Oct 11, 2014
1 parent 4e55e8b commit 82e4454
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
8 changes: 6 additions & 2 deletions src/z3c/rml/attr.py
Expand Up @@ -144,8 +144,12 @@ class Text(RMLAttribute, zope.schema.Text):
"""A simple unicode string."""


class String(Text):
"""Formerly a simple Bytes string, now the same as Text."""
if six.PY2:
class String(RMLAttribute, zope.schema.Bytes):
"""A simple Bytes string."""
else:
class String(Text):
"""Formerly a simple Bytes string, now the same as Text."""


class Integer(RMLAttribute, zope.schema.Int):
Expand Down
15 changes: 11 additions & 4 deletions src/z3c/rml/occurence.py
Expand Up @@ -14,6 +14,7 @@
"""Condition Implementation
"""
import reportlab
import six
import sys
import zope.interface
import zope.schema
Expand All @@ -39,10 +40,16 @@ class IOccurence(zope.interface.Interface):
description=u'The description of the occurence.',
required=True)

tag = zope.schema.TextLine(
title=u'Tag',
description=u'The tag of the sub-directive within the directive',
required=True)
if six.PY2:
tag = zope.schema.BytesLine(
title=u'Tag',
description=u'The tag of the sub-directive within the directive',
required=True)
else:
tag = zope.schema.TextLine(
title=u'Tag',
description=u'The tag of the sub-directive within the directive',
required=True)

signature = zope.schema.Field(
title=u'Signature',
Expand Down
2 changes: 1 addition & 1 deletion test-failures.txt
@@ -1,4 +1,4 @@
Fails in all?
Fails in Python 2 and 3
- rml-examples-029-keepinframe.rml

We've had problems with the keepinframe before: https://github.com/zopefoundation/z3c.rml/commit/bce7f7f25bda98a7101b3e2cf5b28fd988e505c9#commitcomment-2760056
Expand Down

0 comments on commit 82e4454

Please sign in to comment.