Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
MMCV
Commits
82e5c8e5
Unverified
Commit
82e5c8e5
authored
Jul 20, 2020
by
sandyhsia
Committed by
GitHub
Jul 20, 2020
Browse files
fix: close temp file after creating it to avoid permssion problem on windows (#436)
parent
3f936167
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
mmcv/utils/config.py
mmcv/utils/config.py
+3
-0
No files found.
mmcv/utils/config.py
View file @
82e5c8e5
# Copyright (c) Open-MMLab. All rights reserved.
import
ast
import
os.path
as
osp
import
platform
import
re
import
shutil
import
sys
...
...
@@ -120,6 +121,8 @@ class Config:
with
tempfile
.
TemporaryDirectory
()
as
temp_config_dir
:
temp_config_file
=
tempfile
.
NamedTemporaryFile
(
dir
=
temp_config_dir
,
suffix
=
fileExtname
)
if
platform
.
system
()
==
'Windows'
:
temp_config_file
.
close
()
temp_config_name
=
osp
.
basename
(
temp_config_file
.
name
)
# Substitute predefined variables
if
use_predefined_variables
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment