Commit 601a733a authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

py3: follow changes on astroid.

parent 8237ab6e
Pipeline #33354 failed with stage
in 0 seconds
...@@ -161,7 +161,8 @@ class ComponentTool(BaseTool): ...@@ -161,7 +161,8 @@ class ComponentTool(BaseTool):
# Clear pylint cache # Clear pylint cache
try: try:
from astroid.builder import MANAGER from astroid.builder import AstroidManager
MANAGER = AstroidManager()
except ImportError: except ImportError:
pass pass
else: else:
......
...@@ -42,7 +42,8 @@ OptionsManagerMixIn.read_config_file = lambda *args, **kw: None ...@@ -42,7 +42,8 @@ OptionsManagerMixIn.read_config_file = lambda *args, **kw: None
## Pylint transforms and plugin to generate AST for ZODB Components ## Pylint transforms and plugin to generate AST for ZODB Components
from astroid.builder import AstroidBuilder from astroid.builder import AstroidBuilder
from astroid.exceptions import AstroidBuildingException from astroid.exceptions import AstroidBuildingException
from astroid import MANAGER, node_classes from astroid import AstroidManager, node_classes
MANAGER = AstroidManager()
try: try:
from astroid.builder import _guess_encoding from astroid.builder import _guess_encoding
......
...@@ -2217,7 +2217,8 @@ def function_foo(*args, **kwargs): ...@@ -2217,7 +2217,8 @@ def function_foo(*args, **kwargs):
def _assertAstroidCacheContent(self, def _assertAstroidCacheContent(self,
must_be_in_cache_set, must_be_in_cache_set,
must_not_be_in_cache_set): must_not_be_in_cache_set):
from astroid.builder import MANAGER from astroid.builder import AstroidManager
MANAGER = AstroidManager()
should_not_be_in_cache_list = [] should_not_be_in_cache_list = []
for modname in MANAGER.astroid_cache: for modname in MANAGER.astroid_cache:
if (modname.startswith('checkPythonSourceCode') or if (modname.startswith('checkPythonSourceCode') or
...@@ -2490,7 +2491,8 @@ from %(namespace)s.erp5_version import %(reference)s ...@@ -2490,7 +2491,8 @@ from %(namespace)s.erp5_version import %(reference)s
reference=imported_reference)) reference=imported_reference))
component.checkSourceCode() component.checkSourceCode()
from astroid.builder import MANAGER from astroid.builder import AstroidManager
MANAGER = AstroidManager()
imported_module = self._getComponentFullModuleName(imported_reference) imported_module = self._getComponentFullModuleName(imported_reference)
self.assertEqual( self.assertEqual(
MANAGER.astroid_cache[self._getComponentFullModuleName(imported_reference, version='bar')], MANAGER.astroid_cache[self._getComponentFullModuleName(imported_reference, version='bar')],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment