Parcourir la source

[2225_statistics] set methods in Counter

Naoki Kambe il y a 12 ans
Parent
commit
23818a5f2f
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      src/lib/python/isc/statistics/counter.py

+ 3 - 2
src/lib/python/isc/statistics/counter.py

@@ -89,8 +89,9 @@ def init(spec_file_name):
         return _COUNTER
     # create an instance once
     _COUNTER = _Counter(module_spec)
-    # make globals
-    globals().update(_COUNTER._to_global)
+    # set methods in Counter
+    for (k, v) in _COUNTER._to_global.items():
+        setattr(Counter, k, v)
     return _COUNTER
 
 # static internal functions