mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
bpo-30144: Import collections ABC from collections.abc rather than collections. (#1263)
This commit is contained in:
parent
9eb5ca0774
commit
2e576f5aec
22 changed files with 90 additions and 85 deletions
|
@ -9,7 +9,7 @@ operator.repeat(obj, n) -> operator.mul(obj, n)
|
|||
operator.irepeat(obj, n) -> operator.imul(obj, n)
|
||||
"""
|
||||
|
||||
import collections
|
||||
import collections.abc
|
||||
|
||||
# Local imports
|
||||
from lib2to3 import fixer_base
|
||||
|
@ -88,7 +88,7 @@ class FixOperator(fixer_base.BaseFix):
|
|||
|
||||
def _check_method(self, node, results):
|
||||
method = getattr(self, "_" + results["method"][0].value)
|
||||
if isinstance(method, collections.Callable):
|
||||
if isinstance(method, collections.abc.Callable):
|
||||
if "module" in results:
|
||||
return method
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue