Commit 81e3999a authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Jérome Perrin

py3: follow changes on astroid.

parent 76d5d02f
......@@ -159,16 +159,16 @@ class ComponentTool(BaseTool):
erp5.component.filesystem_import_dict = None
erp5.component.ref_manager.gc()
# Clear pylint cache
try:
# Clear astroid (pylint) cache
if six.PY2:
from astroid.builder import MANAGER
except ImportError:
pass
else:
astroid_cache = MANAGER.astroid_cache
for k in astroid_cache.keys():
if k.startswith('erp5.component.') and k not in component_package_list:
del astroid_cache[k]
from astroid.builder import AstroidManager
MANAGER = AstroidManager()
astroid_cache = MANAGER.astroid_cache
for k in list(astroid_cache.keys()):
if k.startswith('erp5.component.') and k not in component_package_list:
del astroid_cache[k]
if reset_portal_type_at_transaction_boundary:
portal.portal_types.resetDynamicDocumentsOnceAtTransactionBoundary()
......
......@@ -42,7 +42,13 @@ OptionsManagerMixIn.read_config_file = lambda *args, **kw: None
## Pylint transforms and plugin to generate AST for ZODB Components
from astroid.builder import AstroidBuilder
from astroid.exceptions import AstroidBuildingException
from astroid import MANAGER, node_classes
from astroid import node_classes
if six.PY2:
from astroid import MANAGER
else:
from astroid import AstroidManager
MANAGER = AstroidManager()
try:
from astroid.builder import _guess_encoding
......
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