Skip to content

Commit 38ec8f4

Browse files
committed
make key.py reflect key from __init__
Fixes #107
1 parent 6ae17c2 commit 38ec8f4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

readchar/key.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# flake8: noqa E401,E403
22
# this file exists only for backwards compatibility
33
# it allows the use of `import readchar.key`
4+
import sys
45

5-
from . import platform
6+
from . import key as __key
67

78

8-
if platform.startswith(("linux", "darwin", "freebsd")):
9-
from ._posix_key import *
10-
elif platform in ("win32", "cygwin"):
11-
from ._win_key import *
12-
else:
13-
raise NotImplementedError(f"The platform {platform} is not supported yet")
9+
for __k, __v in vars(__key).items():
10+
if not __k.startswith("__"):
11+
setattr(sys.modules[__name__], __k, __v)

0 commit comments

Comments
 (0)