Unverified Commit cd873f9c authored by Kai Chen's avatar Kai Chen Committed by GitHub
Browse files

Fix a potential bug of removing temp dir (#218)

* fix a potential bug of removing temp dir

* bump version to v0.4.2
parent 1bc80610
# Copyright (c) Open-MMLab. All rights reserved. # Copyright (c) Open-MMLab. All rights reserved.
__version__ = '0.4.0' __version__ = '0.4.2'
# Copyright (c) Open-MMLab. All rights reserved. # Copyright (c) Open-MMLab. All rights reserved.
import os import os
import os.path as osp import os.path as osp
import shutil
import tempfile import tempfile
from collections import OrderedDict from collections import OrderedDict
...@@ -162,7 +163,7 @@ class TestVideo(object): ...@@ -162,7 +163,7 @@ class TestVideo(object):
filename = '{}/{:03d}.JPEG'.format(frame_dir, i) filename = '{}/{:03d}.JPEG'.format(frame_dir, i)
assert osp.isfile(filename) assert osp.isfile(filename)
os.remove(filename) os.remove(filename)
os.removedirs(frame_dir) shutil.rmtree(frame_dir)
def test_frames2video(self): def test_frames2video(self):
v = mmcv.VideoReader(self.video_path) v = mmcv.VideoReader(self.video_path)
...@@ -193,7 +194,7 @@ class TestVideo(object): ...@@ -193,7 +194,7 @@ class TestVideo(object):
for i in range(self.num_frames): for i in range(self.num_frames):
filename = '{}/{:06d}.jpg'.format(frame_dir, i) filename = '{}/{:06d}.jpg'.format(frame_dir, i)
os.remove(filename) os.remove(filename)
os.removedirs(frame_dir) shutil.rmtree(frame_dir)
os.remove(out_filename) os.remove(out_filename)
def test_cut_concat_video(self): def test_cut_concat_video(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment