from __future__ import absolute_import
from .platforms import platform

__platform = platform()
getkey = __platform.getkey
keys = __platform.keys
key = keys  # alias
bang = __platform.bang

# __all__ = [getkey, key, bang, platform]

__version__ = '0.6'

from __future__ import absolute_import, print_function
import sys
from .platforms import platform, PlatformError

try:
    __platform = platform()
except PlatformError as err:
    print('Error initializing standard platform: {}'.format(err.args[0]),
          file=sys.stderr)
else:
    getkey = __platform.getkey
    keys = __platform.keys
    key = keys  # alias
    bang = __platform.bang

# __all__ = [getkey, key, bang, platform]

__version__ = '0.6'

Handle test environment with no real stdin
Handle test environment with no real stdin

- from __future__ import absolute_import
+ from __future__ import absolute_import, print_function
+ import sys
- from .platforms import platform
+ from .platforms import platform, PlatformError
  
+ try:
- __platform = platform()
+     __platform = platform()
+ except PlatformError as err:
+     print('Error initializing standard platform: {}'.format(err.args[0]),
+           file=sys.stderr)
+ else:
- getkey = __platform.getkey
+     getkey = __platform.getkey
- keys = __platform.keys
+     keys = __platform.keys
- key = keys  # alias
+     key = keys  # alias
- bang = __platform.bang
+     bang = __platform.bang
  
  # __all__ = [getkey, key, bang, platform]
  
  __version__ = '0.6'
  
Handle test environment with no real stdin
## Code Before:
from __future__ import absolute_import
from .platforms import platform

__platform = platform()
getkey = __platform.getkey
keys = __platform.keys
key = keys  # alias
bang = __platform.bang

# __all__ = [getkey, key, bang, platform]

__version__ = '0.6'

## Instruction:
Handle test environment with no real stdin
## Code After:
from __future__ import absolute_import, print_function
import sys
from .platforms import platform, PlatformError

try:
    __platform = platform()
except PlatformError as err:
    print('Error initializing standard platform: {}'.format(err.args[0]),
          file=sys.stderr)
else:
    getkey = __platform.getkey
    keys = __platform.keys
    key = keys  # alias
    bang = __platform.bang

# __all__ = [getkey, key, bang, platform]

__version__ = '0.6'
