Skip to content

Commit

Permalink
changed call location of asyncio.set_event_loop_policy
Browse files Browse the repository at this point in the history
  • Loading branch information
GuyTeichman committed Sep 16, 2024
1 parent 5bbf864 commit 4f088b0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
5 changes: 3 additions & 2 deletions rnalysis/gui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
from multiprocessing import freeze_support
from pathlib import Path

if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

import appdirs
import nest_asyncio

Expand All @@ -18,8 +21,6 @@

def main():
freeze_support()
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
try:
asyncio.run(gui.run())
except RuntimeError:
Expand Down
8 changes: 5 additions & 3 deletions rnalysis/utils/io.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import asyncio
import sys

if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

import concurrent.futures
import contextlib
import csv
Expand All @@ -15,7 +20,6 @@
import shlex
import shutil
import subprocess
import sys
import threading
import time
import typing
Expand Down Expand Up @@ -46,8 +50,6 @@
from rnalysis import __version__
from rnalysis.utils import parsing, validation

if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())


class RandomExpRetry(Retry):
Expand Down
7 changes: 3 additions & 4 deletions rnalysis_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
import sys
from multiprocessing import freeze_support

if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

from rnalysis.gui import gui

if __name__ == '__main__':
freeze_support()

if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

asyncio.run(gui.run())

0 comments on commit 4f088b0

Please sign in to comment.