File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 2828# POSSIBILITY OF SUCH DAMAGE.
2929###
3030
31+ import logging
3132import sys
3233
3334class DynamicScope (object ):
@@ -48,6 +49,18 @@ def __getattr__(self, name):
4849 def __setattr__ (self , name , value ):
4950 self ._getLocals (name )[name ] = value
5051
51- (__builtins__ if isinstance (__builtins__ , dict ) else __builtins__ .__dict__ )['dynamic' ] = DynamicScope ()
52+ class _DynamicScopeBuiltinsWrapper (DynamicScope ):
53+ def __getattr__ (self , name ):
54+ _logger = logging .getLogger ('supybot' )
55+ _logger .warning ('Using DynamicScope without an explicit import is '
56+ 'deprecated and will be removed in a future Limnoria '
57+ 'version. Use instead: '
58+ 'from supybot.dynamicScope import dynamic' ,
59+ stacklevel = 2 , stack_info = True )
60+ return super ().__getattr__ (name )
61+
62+ dynamic = DynamicScope ()
63+ (__builtins__ if isinstance (__builtins__ , dict ) else __builtins__ .__dict__ )['dynamic' ] = \
64+ _DynamicScopeBuiltinsWrapper ()
5265
5366# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
You can’t perform that action at this time.
0 commit comments