Skip to content

Commit

Permalink
refactor: pass tuple to startswith()
Browse files Browse the repository at this point in the history
  • Loading branch information
Cube707 committed Aug 8, 2022
1 parent f06701d commit 9bdb773
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions readchar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
from sys import platform


if (
platform.startswith("linux")
or platform == "darwin"
or platform.startswith("freebsd")
):
if platform.startswith(("linux", "darwin", "freebsd")):
from . import _posix_key as key
from ._posix_read import readchar, readkey
elif platform in ("win32", "cygwin"):
Expand Down
6 changes: 1 addition & 5 deletions readchar/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
from . import platform


if (
platform.startswith("linux")
or platform == "darwin"
or platform.startswith("freebsd")
):
if platform.startswith(("linux", "darwin", "freebsd")):
from ._posix_key import *
elif platform in ("win32", "cygwin"):
from ._win_key import *
Expand Down

0 comments on commit 9bdb773

Please sign in to comment.