Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
Avoid infinite loop when passing IBMQRandomService to child (#805)
Browse files Browse the repository at this point in the history
* check for init

* add release note

(cherry picked from commit 86e3791)
  • Loading branch information
jyu00 committed Nov 12, 2020
1 parent c9743da commit 79b6379
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qiskit/providers/ibmq/random/ibmqrandomservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def __dir__(self) -> Dict:
return self.__dict__

def __getattr__(self, item: str) -> Any:
self._discover_services()
if not self.__getattribute__('_initialized'):
self._discover_services()
try:
return self._services[item]
except KeyError:
Expand Down
5 changes: 5 additions & 0 deletions releasenotes/notes/random-loop-85cc24a9ac024a8f.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
Fixes the infinite loop raised when passing an ``IBMQRandomService`` instance
to a child process.

0 comments on commit 79b6379

Please sign in to comment.