File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 28
28
# POSSIBILITY OF SUCH DAMAGE.
29
29
###
30
30
31
+ import logging
31
32
import sys
32
33
33
34
class DynamicScope (object ):
@@ -48,6 +49,18 @@ def __getattr__(self, name):
48
49
def __setattr__ (self , name , value ):
49
50
self ._getLocals (name )[name ] = value
50
51
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 ()
52
65
53
66
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
You can’t perform that action at this time.
0 commit comments