Skip to content

Commit

Permalink
Merge pull request #82 from plone/python3
Browse files Browse the repository at this point in the history
Fixes for Python 3
  • Loading branch information
jensens authored Aug 16, 2018
2 parents f9e4f20 + 5835567 commit 0cf102e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ New features:

Bug fixes:

- Add support for Python 3.
[davisagli]

- Support for Plone 5.x toolbar, i18n, ...
[jensens]

Expand Down
6 changes: 3 additions & 3 deletions src/plone/app/robotframework/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def create_content(self, *args, **kwargs):
content = None
if HAS_DEXTERITY:
# The title attribute for Dexterity types needs to be unicode
if 'title' in kwargs and isinstance(kwargs['title'], str):
if 'title' in kwargs and isinstance(kwargs['title'], six.binary_type):
kwargs['title'] = kwargs['title'].decode('utf-8')
from plone.dexterity.interfaces import IDexterityFTI
from plone.dexterity.utils import createContentInContainer
Expand Down Expand Up @@ -285,7 +285,7 @@ def prefill_image_types(portal, kwargs):

def random_image():
import random
from six import StringIO
from six import BytesIO
from PIL import Image
from PIL import ImageDraw

Expand All @@ -302,7 +302,7 @@ def random_image():
)
del draw

result = StringIO()
result = BytesIO()
img.save(result, 'PNG')
result.seek(0)
return result
Expand Down
2 changes: 1 addition & 1 deletion src/plone/app/robotframework/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_keyword_names(self):
'get_keyword_documentation',
'run_keyword'
])
names = filter(lambda x: x[0] != '_' and x not in blacklist, dir(self))
names = [x for x in dir(self) if x[0] != '_' and x not in blacklist]
return names

def get_keyword_arguments(self, name):
Expand Down

0 comments on commit 0cf102e

Please sign in to comment.