Skip to content

A input cross compatibility in Pyodide (not MicroPython)! #2471

Description

@MongolOS1162

Checklist

  • I added a descriptive title
  • I searched for other issues and couldn't find a solution or duplication
  • I already searched in Google and didn't find any good information or help

What happened?

Well, I was testing my app, which had terminal worker attribute and there was devices sepration in input.

  1. Non COI/COI doesn't supported to modify browsers gives input as Promise/Async
  2. COI headers changeable browsers gives input as String

I had solution,

import builtins, asyncio, inspect
inputs = input
def _input(prompt=""):
    """Asks for user input"""
    result = inputs(str(prompt))
    if inspect.isawaitable(result):
        return asyncio.run(result)
    else:
        return result
builtins.input = _input

I really hope this could comes by default

Project was I talking and @Ericwasepic127 @MongolOS1162

  • Recently, I made PR which is in here.

What browsers are you seeing the problem on? (if applicable)

Mobile Via browser and Chrome

Console info

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions