def get_compiler_flags(self) -> int:
        """
        Give the current compiler flags by looking for _Feature instances
        in the globals.
        """
        flags = 0

        for value in self.get_globals().values():
            try:
                if isinstance(value, __future__._Feature):
                    f = value.compiler_flag
                    flags |= f
            except BaseException:
                # get_compiler_flags should never raise to not run into an
                # `Unhandled exception in event loop`

                # See: https://github.com/prompt-toolkit/ptpython/issues/351
                # An exception can be raised when some objects in the globals
                # raise an exception in a custom `__getattribute__`.
                pass

        return flags

        Give the current compiler flags by looking for _Feature instances
        in the globals.
        
src/ptpython/python_input.py