Skip to content

Commit

Permalink
Python3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
janjaapdriessen committed Sep 28, 2016
1 parent f4ced45 commit 3382a95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/grokcore/annotation/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
import grokcore.component


@grokcore.component.implementer(IAttributeAnnotatable)
class Model(grokcore.component.Context):
"""Base class for an object which is able to handle annotations
"""
grokcore.component.implements(IAttributeAnnotatable)


class Annotation(persistent.Persistent, contained.Contained):
Expand All @@ -38,8 +38,8 @@ class Annotation(persistent.Persistent, contained.Contained):
"""


@grokcore.component.implementer(IAnnotationFactory)
class AnnotationFactory(object):
implements(IAnnotationFactory)

def __init__(self, factory, name):
self.factory = factory
Expand Down
7 changes: 4 additions & 3 deletions src/grokcore/annotation/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
##############################################################################
"""Grok test helpers
"""
from __future__ import print_function
import sys
from zope.configuration.config import ConfigurationMachine
from grokcore.component import zcml
Expand All @@ -37,7 +38,7 @@ def warn(message, category=None, stacklevel=1):
When zope.deprecation is fixed, this warn function can be removed again.
"""
print "From grok.testing's warn():"
print("From grok.testing's warn():")

frame = sys._getframe(stacklevel)
path = frame.f_globals['__file__']
Expand All @@ -49,10 +50,10 @@ def warn(message, category=None, stacklevel=1):
for i in range(lineno):
line = file.readline()

print "%s:%s: %s: %s\n %s" % (
print("{}:{}: {}: {}\n {}".format(
path,
frame.f_lineno,
category.__name__,
message,
line.strip(),
)
))

0 comments on commit 3382a95

Please sign in to comment.