The internal submodule shouldn't be exposed as part of the public
interface, so mark it private following PEP 8 convention [0].
[0]: https://peps.python.org/pep-0008/#public-and-internal-interfaces
Signed-off-by: Vincent Fazio <vfazio@xes-inc.com>
Link: https://lore.kernel.org/r/20241114145116.2123714-3-vfazio@xes-inc.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
--- /dev/null
+# SPDX-License-Identifier: GPL-2.0-or-later
+# SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
+
+from datetime import timedelta
+from select import select
+from typing import Optional, Union
+
+__all__ = ["poll_fd"]
+
+
+def poll_fd(fd: int, timeout: Optional[Union[timedelta, float]] = None) -> bool:
+ if isinstance(timeout, timedelta):
+ sec = timeout.total_seconds()
+ else:
+ sec = timeout
+
+ readable, _, _ = select([fd], [], [], sec)
+ return True if fd in readable else False
from typing import TYPE_CHECKING, Optional, Union
from . import _ext
+from ._internal import poll_fd
from .exception import ChipClosedError
-from .internal import poll_fd
from .line import Value
from .line_request import LineRequest
from .line_settings import LineSettings, _line_settings_to_ext
+++ /dev/null
-# SPDX-License-Identifier: GPL-2.0-or-later
-# SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
-
-from datetime import timedelta
-from select import select
-from typing import Optional, Union
-
-__all__ = ["poll_fd"]
-
-
-def poll_fd(fd: int, timeout: Optional[Union[timedelta, float]] = None) -> bool:
- if isinstance(timeout, timedelta):
- sec = timeout.total_seconds()
- else:
- sec = timeout
-
- readable, _, _ = select([fd], [], [], sec)
- return True if fd in readable else False
from typing import TYPE_CHECKING, Optional, Union
from . import _ext
-
+from ._internal import poll_fd
from .exception import RequestReleasedError
-from .internal import poll_fd
from .line_settings import LineSettings, _line_settings_to_ext
if TYPE_CHECKING: