Skip to content

Trio fails when using single-use Outcome #505

Closed

Description

@m-u-xyz
_________________________________________ test_epoll_statistics _________________________________________

self = Error(AlreadyUsedError())

    def unwrap(self):
        self._set_unwrapped()
>       raise self.error

../outcome/src/outcome/_sync.py:106: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/contextvars/__init__.py:66: in run
    return callable(*args, **kwargs)
trio/_core/_run.py:938: in init
    self.entry_queue.spawn()
/usr/lib/python3/dist-packages/async_generator/_util.py:42: in __aexit__
    await self._agen.asend(None)
/usr/lib/python3/dist-packages/async_generator/_impl.py:274: in asend
    return await self._do_it(self._it.send, value)
/usr/lib/python3/dist-packages/async_generator/_impl.py:290: in _do_it
    return await ANextIter(self._it, start_fn, *args)
/usr/lib/python3/dist-packages/async_generator/_impl.py:202: in send
    return self._invoke(self._it.send, value)
/usr/lib/python3/dist-packages/async_generator/_impl.py:209: in _invoke
    result = fn(*args)
trio/_core/_run.py:313: in open_nursery
    await nursery._nested_child_finished(nested_child_exc)
trio/_core/_run.py:411: in _nested_child_finished
    await wait_task_rescheduled(aborted)
trio/_core/_traps.py:159: in wait_task_rescheduled
    return (await _async_yield(WaitTaskRescheduled(abort_func))).unwrap()
../outcome/src/outcome/_sync.py:84: in unwrap
    self._set_unwrapped()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = Value(None)

    def _set_unwrapped(self):
        if self._unwrapped:
>           raise AlreadyUsedError
E           outcome.AlreadyUsedError

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions