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
e92f826a
Unverified
Commit
e92f826a
authored
Aug 11, 2020
by
Kai Chen
Committed by
GitHub
Aug 11, 2020
Browse files
close the config file after opening (#480)
parent
cac22f8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
mmcv/utils/config.py
mmcv/utils/config.py
+3
-2
No files found.
mmcv/utils/config.py
View file @
e92f826a
...
...
@@ -88,7 +88,7 @@ class Config:
@
staticmethod
def
_validate_py_syntax
(
filename
):
with
open
(
filename
)
as
f
:
with
open
(
filename
,
'r'
)
as
f
:
content
=
f
.
read
()
try
:
ast
.
parse
(
content
)
...
...
@@ -107,7 +107,8 @@ class Config:
fileBasename
=
file_basename
,
fileBasenameNoExtension
=
file_basename_no_extension
,
fileExtname
=
file_extname
)
config_file
=
open
(
filename
).
read
()
with
open
(
filename
,
'r'
)
as
f
:
config_file
=
f
.
read
()
for
key
,
value
in
support_templates
.
items
():
regexp
=
r
'\{\{\s*'
+
str
(
key
)
+
r
'\s*\}\}'
config_file
=
re
.
sub
(
regexp
,
value
,
config_file
)
...
...
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