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
86f8ade9
Unverified
Commit
86f8ade9
authored
Apr 25, 2022
by
Tan SU
Committed by
GitHub
Apr 25, 2022
Browse files
[Fix] Fix collec_env() encoding error on Windows (#1905)
parent
94c071b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
mmcv/utils/env.py
mmcv/utils/env.py
+3
-1
No files found.
mmcv/utils/env.py
View file @
86f8ade9
...
...
@@ -81,13 +81,15 @@ def collect_env():
# on Windows, cl.exe is not in PATH. We need to find the path.
# distutils.ccompiler.new_compiler() returns a msvccompiler
# object and after initialization, path to cl.exe is found.
import
locale
import
os
from
distutils.ccompiler
import
new_compiler
ccompiler
=
new_compiler
()
ccompiler
.
initialize
()
cc
=
subprocess
.
check_output
(
f
'
{
ccompiler
.
cc
}
'
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
)
encoding
=
os
.
device_encoding
(
sys
.
stdout
.
fileno
())
or
'utf-8'
encoding
=
os
.
device_encoding
(
sys
.
stdout
.
fileno
())
or
locale
.
getpreferredencoding
()
env_info
[
'MSVC'
]
=
cc
.
decode
(
encoding
).
partition
(
'
\n
'
)[
0
].
strip
()
env_info
[
'GCC'
]
=
'n/a'
except
subprocess
.
CalledProcessError
:
...
...
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