Skip to content

Commit

Permalink
Remove redundant loop changes in directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrachuk committed Jan 21, 2020
1 parent a18281b commit 6f2dce0
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions lightweight/files.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
import os
from contextlib import contextmanager
from glob import glob
Expand Down Expand Up @@ -37,9 +36,5 @@ def directory(location: Union[str, Path]):
"""
cwd = os.getcwd()
os.chdir(str(location))
prev_loop = asyncio.get_event_loop()
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
yield
os.chdir(cwd)
asyncio.set_event_loop(prev_loop)

0 comments on commit 6f2dce0

Please sign in to comment.