File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 6
6
"""Defines :class:`scopedef_t` class"""
7
7
8
8
import timeit
9
- import collections
9
+ try :
10
+ from collections .abc import Callable
11
+ except ImportError :
12
+ from collections import Callable
10
13
11
14
from . import algorithm
12
15
from . import templates
@@ -312,7 +315,7 @@ def init_optimizer(self):
312
315
313
316
@staticmethod
314
317
def _build_operator_function (name , function ):
315
- if isinstance (name , collections . Callable ):
318
+ if isinstance (name , Callable ):
316
319
return name
317
320
318
321
return function
@@ -324,7 +327,7 @@ def add_operator(sym):
324
327
if 'new' in sym or 'delete' in sym :
325
328
return 'operator ' + sym
326
329
return 'operator' + sym
327
- if isinstance (name , collections . Callable ) and None is function :
330
+ if isinstance (name , Callable ) and None is function :
328
331
name = None
329
332
if name :
330
333
if 'operator' not in name :
@@ -347,7 +350,7 @@ def _on_rename(self):
347
350
@staticmethod
348
351
def __normalize_args (** keywds ):
349
352
"""implementation details"""
350
- if isinstance (keywds ['name' ], collections . Callable ) and \
353
+ if isinstance (keywds ['name' ], Callable ) and \
351
354
None is keywds ['function' ]:
352
355
keywds ['function' ] = keywds ['name' ]
353
356
keywds ['name' ] = None
You can’t perform that action at this time.
0 commit comments