in src/base64io/__init__.py [0:0]
def _passthrough_interactive_check(self, method_name, mode):
# type: (str, str) -> bool
"""Attempt to call the specified method on the wrapped stream and return the result.
If the method is not found on the wrapped stream, return False.
.. note::
Special Case: If wrapped stream is a Python 2 file, inspect the file mode.
:param str method_name: Name of method to call
:param str mode: Python 2 mode character
:rtype: bool
"""
try:
method = getattr(self.__wrapped, method_name)
except AttributeError:
if (
_py2()
# pylint: disable=isinstance-second-argument-not-valid-type, possibly-used-before-assignment
and isinstance(self.__wrapped, file)
and mode in self.__wrapped.mode
):
return True
return False
return method()