collections.Callable -> collections.abc.Callable
"Deprecated since version 3.3, will be removed in version 3.10" - https://docs.python.org/3/library/collections.html
This commit is contained in:
parent
8f0ec59f95
commit
6605bf406d
@ -27,7 +27,7 @@ Qubes OS
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
import builtins
|
import builtins
|
||||||
import collections
|
import collections.abc
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import string
|
import string
|
||||||
@ -146,11 +146,11 @@ class property: # pylint: disable=redefined-builtin,invalid-name
|
|||||||
or, when no default, py:class:`exceptions.AttributeError`.
|
or, when no default, py:class:`exceptions.AttributeError`.
|
||||||
|
|
||||||
:param str name: name of the property
|
:param str name: name of the property
|
||||||
:param collections.Callable setter: if not :py:obj:`None`, this is used to \
|
:param collections.abc.Callable setter: if not :py:obj:`None`, this is \
|
||||||
initialise value; first parameter to the function is holder instance \
|
used to initialise value; first parameter to the function is holder \
|
||||||
and the second is value; this is called before ``type``
|
instance and the second is value; this is called before ``type``
|
||||||
:param collections.Callable saver: function to coerce value to something \
|
:param collections.abc.Callable saver: function to coerce value to \
|
||||||
readable by setter
|
something readable by setter
|
||||||
:param type type: if not :py:obj:`None`, value is coerced to this type
|
:param type type: if not :py:obj:`None`, value is coerced to this type
|
||||||
:param object default: default value; if callable, will be called with \
|
:param object default: default value; if callable, will be called with \
|
||||||
holder as first argument
|
holder as first argument
|
||||||
@ -203,7 +203,7 @@ class property: # pylint: disable=redefined-builtin,invalid-name
|
|||||||
self.type = type
|
self.type = type
|
||||||
self._default = default
|
self._default = default
|
||||||
self._default_function = None
|
self._default_function = None
|
||||||
if isinstance(default, collections.Callable):
|
if isinstance(default, collections.abc.Callable):
|
||||||
self._default_function = default
|
self._default_function = default
|
||||||
|
|
||||||
self._write_once = write_once
|
self._write_once = write_once
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
# License along with this library; if not, see <https://www.gnu.org/licenses/>.
|
# License along with this library; if not, see <https://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
|
|
||||||
import collections
|
import collections.abc
|
||||||
import copy
|
import copy
|
||||||
import functools
|
import functools
|
||||||
import grp
|
import grp
|
||||||
@ -95,7 +95,7 @@ class VirDomainWrapper:
|
|||||||
|
|
||||||
def __getattr__(self, attrname):
|
def __getattr__(self, attrname):
|
||||||
attr = getattr(self._vm, attrname)
|
attr = getattr(self._vm, attrname)
|
||||||
if not isinstance(attr, collections.Callable):
|
if not isinstance(attr, collections.abc.Callable):
|
||||||
return attr
|
return attr
|
||||||
|
|
||||||
@functools.wraps(attr)
|
@functools.wraps(attr)
|
||||||
@ -135,7 +135,7 @@ class VirConnectWrapper:
|
|||||||
|
|
||||||
def __getattr__(self, attrname):
|
def __getattr__(self, attrname):
|
||||||
attr = getattr(self._conn, attrname)
|
attr = getattr(self._conn, attrname)
|
||||||
if not isinstance(attr, collections.Callable):
|
if not isinstance(attr, collections.abc.Callable):
|
||||||
return attr
|
return attr
|
||||||
if attrname == 'close':
|
if attrname == 'close':
|
||||||
return attr
|
return attr
|
||||||
|
@ -116,7 +116,7 @@ class Emitter(metaclass=EmitterMeta):
|
|||||||
This is class method, it is invalid to call it on object instance.
|
This is class method, it is invalid to call it on object instance.
|
||||||
|
|
||||||
:param str event: event identificator
|
:param str event: event identificator
|
||||||
:param collections.Callable handler: handler callable
|
:param collections.abc.Callable handler: handler callable
|
||||||
'''
|
'''
|
||||||
|
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
@ -131,7 +131,7 @@ class Emitter(metaclass=EmitterMeta):
|
|||||||
:py:meth:`add_handler` was called to register the handler.
|
:py:meth:`add_handler` was called to register the handler.
|
||||||
|
|
||||||
:param str event: event identificator
|
:param str event: event identificator
|
||||||
:param collections.Callable handler: handler callable
|
:param collections.abc.Callable handler: handler callable
|
||||||
'''
|
'''
|
||||||
|
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
|
@ -1072,7 +1072,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
|
|||||||
"""Start domain
|
"""Start domain
|
||||||
|
|
||||||
:param bool start_guid: FIXME
|
:param bool start_guid: FIXME
|
||||||
:param collections.Callable notify_function: FIXME
|
:param collections.abc.Callable notify_function: FIXME
|
||||||
:param int mem_required: FIXME
|
:param int mem_required: FIXME
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user