Skip to content

Commit

Permalink
Stacklevel 2 doesn't make much sense in warnings within ZCML handlers…
Browse files Browse the repository at this point in the history
…. I'd rather

have the ZCML filename and line no. be stated, not the Python module. Perhaps later.
  • Loading branch information
philikon committed Feb 18, 2006
1 parent bf583ee commit 9246bdc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions browser/metaconfigure.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ def layer(_context, name=None, interface=None, base=IBrowserRequest):
'Creating layers via ZCML has been deprecated. The browser:layer '
'directive will be removed in Zope 3.5. Layers are now interfaces '
'extending zope.publisher.interfaces.browser.IBrowserRequest. '
'They do not need further registration.',
DeprecationWarning, stacklevel=2)
'They do not need further registration.', DeprecationWarning)
interface = InterfaceClass(str(name), (base, ),
__doc__='Layer: %s' %str(name),
__module__='zope.app.layers')
Expand All @@ -179,7 +178,7 @@ def layer(_context, name=None, interface=None, base=IBrowserRequest):
warnings.warn(
'Layer interfaces do not require registration anymore. The '
'browser:layer directive will be removed in Zope 3.5.',
DeprecationWarning, stacklevel=2)
DeprecationWarning)
path = interface.__module__ + '.' + interface.getName()

# If a name was specified, make this layer available under this name.
Expand Down Expand Up @@ -285,7 +284,7 @@ def skin(_context, name=None, interface=None, layers=None):
'directive will be removed in Zope 3.5. Skins are now interfaces '
'extending zope.publisher.interfaces.browser.IBrowserRequest. '
'They are registered using the \'interface\' directive.',
DeprecationWarning, stacklevel=2)
DeprecationWarning)
interface = InterfaceClass(str(name), layers,
__doc__='Skin: %s' %str(name),
__module__='zope.app.skins')
Expand Down Expand Up @@ -314,8 +313,7 @@ def skin(_context, name=None, interface=None, layers=None):
' interface="%s"\n'
' type="zope.publisher.interfaces.browser.IBrowserSkinType"\n'
' name="%s"\n'
' />' % (path, name),
DeprecationWarning, stacklevel=2)
' />' % (path, name), DeprecationWarning)

# Register the skin interface as a skin using the passed name.
if name is not None:
Expand Down

0 comments on commit 9246bdc

Please sign in to comment.