[Checkins] SVN: zope.component/tseaver-test_cleanup/ Python 3.2 support (same caveats as PyPy).
Tres Seaver
cvs-admin at zope.org
Wed Jun 27 21:51:41 UTC 2012
Log message for revision 127140:
Python 3.2 support (same caveats as PyPy).
Changed:
_U zope.component/tseaver-test_cleanup/
U zope.component/tseaver-test_cleanup/.bzrignore
U zope.component/tseaver-test_cleanup/CHANGES.txt
U zope.component/tseaver-test_cleanup/setup.py
U zope.component/tseaver-test_cleanup/src/zope/component/_api.py
A zope.component/tseaver-test_cleanup/src/zope/component/_compat.py
U zope.component/tseaver-test_cleanup/src/zope/component/_declaration.py
U zope.component/tseaver-test_cleanup/src/zope/component/eventtesting.py
U zope.component/tseaver-test_cleanup/src/zope/component/globalregistry.py
U zope.component/tseaver-test_cleanup/src/zope/component/interface.py
U zope.component/tseaver-test_cleanup/src/zope/component/interfaces.py
U zope.component/tseaver-test_cleanup/src/zope/component/standalonetests.py
U zope.component/tseaver-test_cleanup/src/zope/component/testfiles/adapter.py
U zope.component/tseaver-test_cleanup/src/zope/component/testfiles/components.py
U zope.component/tseaver-test_cleanup/src/zope/component/testfiles/views.py
U zope.component/tseaver-test_cleanup/src/zope/component/tests/examples.py
U zope.component/tseaver-test_cleanup/src/zope/component/tests/test_globalregistry.py
U zope.component/tseaver-test_cleanup/src/zope/component/tests/test_standalone.py
U zope.component/tseaver-test_cleanup/src/zope/component/tests/test_zcml.py
U zope.component/tseaver-test_cleanup/src/zope/component/zcml.py
U zope.component/tseaver-test_cleanup/tox.ini
-=-
Modified: zope.component/tseaver-test_cleanup/.bzrignore
===================================================================
--- zope.component/tseaver-test_cleanup/.bzrignore 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/.bzrignore 2012-06-27 21:51:35 UTC (rev 127140)
@@ -10,3 +10,4 @@
.tox
nosetests.xml
coverage.xml
+__pycache__
Modified: zope.component/tseaver-test_cleanup/CHANGES.txt
===================================================================
--- zope.component/tseaver-test_cleanup/CHANGES.txt 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/CHANGES.txt 2012-06-27 21:51:35 UTC (rev 127140)
@@ -4,7 +4,7 @@
4.0.0 (unreleased)
==================
-- Added PyPy support:
+- Added PyPy and Python 3.2 support:
- Security support omitted until ``zope.security`` ported.
Modified: zope.component/tseaver-test_cleanup/setup.py
===================================================================
--- zope.component/tseaver-test_cleanup/setup.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/setup.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -91,9 +91,10 @@
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
- "Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.2",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
Modified: zope.component/tseaver-test_cleanup/src/zope/component/_api.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/_api.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/_api.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -25,6 +25,7 @@
from zope.component.interfaces import IFactory
from zope.component.interfaces import ComponentLookupError
from zope.component.interfaces import IComponentLookup
+from zope.component._compat import _BLANK
from zope.component._declaration import adaptedBy
from zope.component._declaration import adapter
from zope.component._declaration import adapts
@@ -54,7 +55,7 @@
# to avoid the recursion implied by using a local `getAdapter()` call.
try:
return IComponentLookup(context)
- except TypeError, error:
+ except TypeError as error:
raise ComponentLookupError(*error.args)
# Adapter API
@@ -92,26 +93,26 @@
return getSiteManager(context).queryAdapter(object, interface, '', default)
-def getAdapter(object, interface=Interface, name=u'', context=None):
+def getAdapter(object, interface=Interface, name=_BLANK, context=None):
adapter = queryAdapter(object, interface, name, None, context)
if adapter is None:
raise ComponentLookupError(object, interface, name)
return adapter
-def queryAdapter(object, interface=Interface, name=u'', default=None,
+def queryAdapter(object, interface=Interface, name=_BLANK, default=None,
context=None):
if context is None:
return adapter_hook(interface, object, name, default)
return getSiteManager(context).queryAdapter(object, interface, name,
default)
-def getMultiAdapter(objects, interface=Interface, name=u'', context=None):
+def getMultiAdapter(objects, interface=Interface, name=_BLANK, context=None):
adapter = queryMultiAdapter(objects, interface, name, context=context)
if adapter is None:
raise ComponentLookupError(objects, interface, name)
return adapter
-def queryMultiAdapter(objects, interface=Interface, name=u'', default=None,
+def queryMultiAdapter(objects, interface=Interface, name=_BLANK, default=None,
context=None):
try:
sitemanager = getSiteManager(context)
Added: zope.component/tseaver-test_cleanup/src/zope/component/_compat.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/_compat.py (rev 0)
+++ zope.component/tseaver-test_cleanup/src/zope/component/_compat.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -0,0 +1,42 @@
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+
+import sys
+import types
+
+if sys.version_info[0] < 3: #pragma NO COVER
+
+ import cPickle as _pickle
+
+ def _u(s):
+ return unicode(s, 'unicode_escape')
+
+ CLASS_TYPES = (type, types.ClassType)
+
+ PYTHON3 = False
+ PYTHON2 = True
+
+else: #pragma NO COVER
+
+ import pickle as _pickle
+
+ def _u(s):
+ return s
+
+ CLASS_TYPES = (type,)
+
+ PYTHON3 = True
+ PYTHON2 = False
+
+_BLANK = _u('')
Modified: zope.component/tseaver-test_cleanup/src/zope/component/_declaration.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/_declaration.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/_declaration.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -13,16 +13,17 @@
##############################################################################
"""Adapter declarations
"""
-import types
import sys
+from zope.component._compat import CLASS_TYPES
+
class adapter(object):
def __init__(self, *interfaces):
self.interfaces = interfaces
def __call__(self, ob):
- if isinstance(ob, _class_types):
+ if isinstance(ob, CLASS_TYPES):
ob.__component_adapts__ = _adapts_descr(self.interfaces)
else:
ob.__component_adapts__ = self.interfaces
@@ -45,8 +46,6 @@
def adaptedBy(ob):
return getattr(ob, '__component_adapts__', None)
-_class_types = type, types.ClassType
-
class _adapts_descr(object):
def __init__(self, interfaces):
self.interfaces = interfaces
Modified: zope.component/tseaver-test_cleanup/src/zope/component/eventtesting.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/eventtesting.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/eventtesting.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -22,7 +22,7 @@
from zope.component.registry import dispatchHandlerRegistrationEvent
try:
from zope.testing.cleanup import addCleanUp
-except ImportError:
+except ImportError: #pragma NO COVER
def addCleanUp(x):
pass
Modified: zope.component/tseaver-test_cleanup/src/zope/component/globalregistry.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/globalregistry.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/globalregistry.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -13,10 +13,12 @@
##############################################################################
"""Global components support
"""
-from zope.interface import implements
+from zope.interface import implementer
from zope.interface.adapter import AdapterRegistry
from zope.interface.registry import Components
+
from zope.component.interfaces import IComponentLookup
+from zope.component._compat import _BLANK
def GAR(components, registryName):
return getattr(components, registryName)
@@ -35,8 +37,8 @@
def __reduce__(self):
return GAR, (self.__parent__, self.__name__)
+ at implementer(IComponentLookup)
class BaseGlobalComponents(Components):
- implements(IComponentLookup)
def _init_registries(self):
self.adapters = GlobalAdapterRegistry(self, 'adapters')
@@ -64,10 +66,10 @@
# We eventually want to deprecate these in favor of using the global
# component registry directly.
-def provideUtility(component, provides=None, name=u''):
+def provideUtility(component, provides=None, name=_BLANK):
base.registerUtility(component, provides, name, event=False)
-def provideAdapter(factory, adapts=None, provides=None, name=''):
+def provideAdapter(factory, adapts=None, provides=None, name=_BLANK):
base.registerAdapter(factory, adapts, provides, name, event=False)
def provideSubscriptionAdapter(factory, adapts=None, provides=None):
Modified: zope.component/tseaver-test_cleanup/src/zope/component/interface.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/interface.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/interface.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -13,15 +13,14 @@
##############################################################################
"""Interface utility functions
"""
-__docformat__ = 'restructuredtext'
-
-from types import ClassType
-
-import zope.component
-from zope.component.interfaces import ComponentLookupError
from zope.interface import alsoProvides
from zope.interface.interfaces import IInterface
+from zope.component.globalregistry import getGlobalSiteManager
+from zope.component.interfaces import ComponentLookupError
+from zope.component._api import queryUtility
+from zope.component._compat import CLASS_TYPES
+
def provideInterface(id, interface, iface_type=None, info=''):
""" Mark 'interface' as a named utilty providing 'iface_type'.
"""
@@ -29,7 +28,7 @@
id = "%s.%s" % (interface.__module__, interface.__name__)
if not IInterface.providedBy(interface):
- if not isinstance(interface, (type, ClassType)):
+ if not isinstance(interface, CLASS_TYPES):
raise TypeError(id, "is not an interface or class")
return
@@ -40,7 +39,7 @@
else:
iface_type = IInterface
- gsm = zope.component.getGlobalSiteManager()
+ gsm = getGlobalSiteManager()
gsm.registerUtility(interface, iface_type, id, info)
@@ -56,7 +55,7 @@
def queryInterface(id, default=None):
"""Return an interface or ``None``
"""
- return zope.component.queryUtility(IInterface, id, default)
+ return queryUtility(IInterface, id, default)
def searchInterface(context, search_string=None, base=None):
@@ -74,7 +73,7 @@
def searchInterfaceUtilities(context, search_string=None, base=None):
- gsm = zope.component.getGlobalSiteManager()
+ gsm = getGlobalSiteManager()
iface_utilities = gsm.getUtilitiesFor(IInterface)
if search_string:
Modified: zope.component/tseaver-test_cleanup/src/zope/component/interfaces.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/interfaces.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/interfaces.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -38,6 +38,9 @@
from zope.interface.interfaces import IComponentRegistry
from zope.interface.interfaces import IComponents
+from zope.component._compat import _BLANK
+
+
class IComponentArchitecture(Interface):
"""The Component Architecture is defined by two key components: Adapters
and Utiltities. Both are managed by site managers. All other components
@@ -112,7 +115,7 @@
# Adapter API
def getAdapter(object,
- interface=Interface, name=u'',
+ interface=Interface, name=_BLANK,
context=None):
"""Get a named adapter to an interface for an object
@@ -167,7 +170,7 @@
named adapter methods with an empty string for a name.
"""
- def queryAdapter(object, interface=Interface, name=u'',
+ def queryAdapter(object, interface=Interface, name=_BLANK,
default=None, context=None):
"""Look for a named adapter to an interface for an object
@@ -204,7 +207,7 @@
"""
def queryMultiAdapter(objects,
- interface=Interface, name=u'',
+ interface=Interface, name=_BLANK,
default=None,
context=None):
"""Look for a multi-adapter to an interface for objects
@@ -316,7 +319,7 @@
activity.
"""
- def provideUtility(component, provides=None, name=u''):
+ def provideUtility(component, provides=None, name=_BLANK):
"""Register a utility globally
A utility is registered to provide an interface with a
@@ -332,7 +335,7 @@
"""
- def provideAdapter(factory, adapts=None, provides=None, name=u''):
+ def provideAdapter(factory, adapts=None, provides=None, name=_BLANK):
"""Register an adapter globally
An adapter is registered to provide an interface with a name
Modified: zope.component/tseaver-test_cleanup/src/zope/component/standalonetests.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/standalonetests.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/standalonetests.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -4,9 +4,17 @@
import sys
import pickle
+def write(x):
+ sys.stdout.write('%s\n' % x)
+
if __name__ == "__main__": #pragma NO COVER (runs in subprocess)
- sys.path = pickle.loads(sys.stdin.read())
+ #sys.path = pickle.loads(sys.stdin.read())
+ write('XXXXXXXXXX')
+ for p in sys.path:
+ write('- %s' % p)
+ write('XXXXXXXXXX')
+ import zope
from zope.interface import Interface
from zope.interface import implementer
@@ -28,9 +36,14 @@
def __init__(self, context):
self.context = context
+ write('YYYYYYYYY')
+ for p in zope.__path__:
+ write('- %s' % p)
+ write('YYYYYYYYY')
import zope.component
zope.component.provideAdapter(Comp, (I1,), I2)
adapter = I2(ob)
+ write('ZZZZZZZZ')
assert adapter.__class__ is Comp
assert adapter.context is ob
Modified: zope.component/tseaver-test_cleanup/src/zope/component/testfiles/adapter.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/testfiles/adapter.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/testfiles/adapter.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -13,22 +13,25 @@
##############################################################################
"""Sample adapter class for testing
"""
-import zope.interface
-import zope.component
-import components
-class I1(zope.interface.Interface):
+from zope.interface import Interface
+from zope.interface import implementer
+
+from zope.component import adapter
+from zope.component.testfiles import components
+
+class I1(Interface):
pass
-class I2(zope.interface.Interface):
+class I2(Interface):
pass
-class I3(zope.interface.Interface):
+class I3(Interface):
def f1(): pass
def f2(): pass
def f3(): pass
-class IS(zope.interface.Interface):
+class IS(Interface):
pass
@@ -36,23 +39,27 @@
def __init__(self, *args):
self.context = args
+ at implementer(I1)
class A1(Adapter):
- zope.interface.implements(I1)
+ pass
+ at implementer(I2)
class A2(Adapter):
- zope.interface.implements(I2)
+ pass
+ at adapter(components.IContent, I1, I2)
+ at implementer(I3)
class A3(Adapter):
- zope.component.adapts(components.IContent, I1, I2)
- zope.interface.implements(I3)
+ pass
class A4:
pass
a4 = A4()
+ at implementer(I1, I2)
class A5:
- zope.interface.implements(I1, I2)
+ pass
a5 = A5()
Modified: zope.component/tseaver-test_cleanup/src/zope/component/testfiles/components.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/testfiles/components.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/testfiles/components.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -13,8 +13,10 @@
##############################################################################
"""Components for testing
"""
-from zope.interface import Interface, Attribute, implements
-from zope.component import adapts
+from zope.interface import Interface
+from zope.interface import Attribute
+from zope.interface import implementer
+from zope.component import adapter
class IAppb(Interface):
a = Attribute('test attribute')
@@ -31,12 +33,14 @@
class IContent(Interface): pass
+ at implementer(IContent)
class Content(object):
- implements(IContent)
+ pass
+ at adapter(IContent)
+ at implementer(IApp)
class Comp(object):
- adapts(IContent)
- implements(IApp)
+ pass
def __init__(self, *args):
# Ignore arguments passed to constructor
Modified: zope.component/tseaver-test_cleanup/src/zope/component/testfiles/views.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/testfiles/views.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/testfiles/views.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -13,8 +13,11 @@
##############################################################################
"""Views test.
"""
-from zope.interface import Interface, implements, directlyProvides
+from zope.interface import Interface
+from zope.interface import implementer
+from zope.interface import directlyProvides
+
class Request(object):
def __init__(self, type):
@@ -29,8 +32,8 @@
class IC(Interface): pass
+ at implementer(IV)
class V1(object):
- implements(IV)
def __init__(self, context, request):
self.context = context
@@ -46,6 +49,7 @@
def index(self):
return 'ZMI here'
+ at implementer(IV)
class R1(object):
def index(self):
@@ -57,7 +61,6 @@
def __init__(self, request):
pass
- implements(IV)
class RZMI(R1):
pass
Modified: zope.component/tseaver-test_cleanup/src/zope/component/tests/examples.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/tests/examples.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/tests/examples.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -13,6 +13,8 @@
##############################################################################
"""Examples supporting Sphinx doctest snippets.
"""
+import sys
+
from zope.interface import Interface
from zope.interface import implementer
from zope.interface.interfaces import IInterface
@@ -20,6 +22,9 @@
from zope.component._declaration import adapter
from zope.component.testfiles.views import IC
+def write(x):
+ sys.stdout.write('%s\n' % x)
+
class ITestType(IInterface):
pass
@@ -69,18 +74,18 @@
@adapter(I1)
def handle1(x):
- print 'handle1', x
+ write('handle1 %s' % x)
def handle2(*objects):
- print 'handle2', objects
+ write( 'handle2 ' + repr(objects))
@adapter(I1)
def handle3(x):
- print 'handle3', x
+ write( 'handle3 %s' % x)
@adapter(I1)
def handle4(x):
- print 'handle4', x
+ write( 'handle4 %s' % x)
class GlobalRegistry:
pass
Modified: zope.component/tseaver-test_cleanup/src/zope/component/tests/test_globalregistry.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/tests/test_globalregistry.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/tests/test_globalregistry.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -33,18 +33,18 @@
self.assertTrue(self._callFUT() is gsm)
def test_gsm_pickling(self):
- import cPickle
+ from zope.component._compat import _pickle
gsm = self._callFUT()
- dumped = cPickle.dumps(gsm)
- loaded = cPickle.loads(dumped)
+ dumped = _pickle.dumps(gsm)
+ loaded = _pickle.loads(dumped)
self.assertTrue(loaded is gsm)
- dumped_utilities = cPickle.dumps(gsm.utilities)
- loaded_utilities = cPickle.loads(dumped_utilities)
+ dumped_utilities = _pickle.dumps(gsm.utilities)
+ loaded_utilities = _pickle.loads(dumped_utilities)
self.assertTrue(loaded_utilities is gsm.utilities)
- dumped_adapters = cPickle.dumps(gsm.adapters)
- loaded_adapters = cPickle.loads(dumped_adapters)
+ dumped_adapters = _pickle.dumps(gsm.adapters)
+ loaded_adapters = _pickle.loads(dumped_adapters)
self.assertTrue(loaded_adapters is gsm.adapters)
Modified: zope.component/tseaver-test_cleanup/src/zope/component/tests/test_standalone.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/tests/test_standalone.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/tests/test_standalone.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -36,10 +36,15 @@
try:
rc = process.wait()
- except OSError, e:
+ except OSError as e:
if e.errno != 4: # MacIntel raises apparently unimportant EINTR?
raise # TODO verify sanity of a pass on EINTR :-/
- self.assertEqual(rc, 0)
+ if rc != 0:
+ output = process.stdout.read()
+ sys.stderr.write('#' * 80 + '\n')
+ sys.stdout.write(output)
+ sys.stderr.write('#' * 80 + '\n')
+ self.fail('Output code: %d' % rc)
def test_suite():
return unittest.TestSuite((
Modified: zope.component/tseaver-test_cleanup/src/zope/component/tests/test_zcml.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/tests/test_zcml.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/tests/test_zcml.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -30,9 +30,10 @@
return handler(*args, **kw)
def test_uses_configured_site_manager(self):
+ from zope.interface.registry import Components
from zope.component import getSiteManager
from zope.component.testfiles.components import comp, IApp
- from zope.interface.registry import Components
+ from zope.component._compat import _BLANK
registry = Components()
def dummy(context=None):
@@ -40,7 +41,7 @@
getSiteManager.sethook(dummy)
try:
- self._callFUT('registerUtility', comp, IApp, u'')
+ self._callFUT('registerUtility', comp, IApp, _BLANK)
self.assertTrue(registry.getUtility(IApp) is comp)
finally:
getSiteManager.reset()
Modified: zope.component/tseaver-test_cleanup/src/zope/component/zcml.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/zcml.py 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/src/zope/component/zcml.py 2012-06-27 21:51:35 UTC (rev 127140)
@@ -28,6 +28,7 @@
from zope.component._api import getSiteManager
from zope.component._declaration import adaptedBy
from zope.component.interface import provideInterface
+from zope.component._compat import _BLANK
try:
from zope.security.zcml import Permission
@@ -322,14 +323,14 @@
discriminator = None,
callable = _handler,
args = ('registerHandler',
- handler, for_, u'', _context.info),
+ handler, for_, _BLANK, _context.info),
)
else:
_context.action(
discriminator = None,
callable = _handler,
args = ('registerSubscriptionAdapter',
- factory, for_, provides, u'', _context.info),
+ factory, for_, provides, _BLANK, _context.info),
)
if provides is not None:
@@ -481,7 +482,7 @@
title=_("The name of the resource."),
description=_("The name shows up in URLs/paths. For example 'foo'."),
required=True,
- default=u'',
+ default=_BLANK,
)
provides = GlobalInterface(
Modified: zope.component/tseaver-test_cleanup/tox.ini
===================================================================
--- zope.component/tseaver-test_cleanup/tox.ini 2012-06-27 16:30:13 UTC (rev 127139)
+++ zope.component/tseaver-test_cleanup/tox.ini 2012-06-27 21:51:35 UTC (rev 127140)
@@ -3,7 +3,7 @@
# Jython support pending 2.7 support, due 2012-07-15 or so. See:
# http://fwierzbicki.blogspot.com/2012/03/adconion-to-fund-jython-27.html
# py26,py27,py32,jython,pypy,coverage,docs
- py26,py26min,py27,pypy,coverage,docs
+ py26,py26min,py27,pypy,py32,coverage,docs
[testenv]
deps =
@@ -48,6 +48,23 @@
pip install -e .
nosetests -I persistentregistry -I security
+
+[testenv:py32]
+deps =
+ zope.component
+ zope.interface
+ zope.event
+ zope.hookable
+ zope.configuration
+ zope.schema
+ zope.i18nmessageid
+ nose
+commands =
+ pip uninstall -y zope.component
+ python -c "import shutil; shutil.copyfile('src/zope/__init__.py', '{envdir}/lib/python3.2/site-packages/zope/__init__.py')"
+ pip install -e .
+ nosetests -I persistentregistry -I security
+
[testenv:pypy]
deps =
zope.component
More information about the checkins
mailing list