mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 06:35:12 +00:00
Specified encoding in setup.py calls of open() (#3137)
* Specified encoding in setup.py calls of open() * Fix for Python2 Co-authored-by: Karsten Bock <karsten.bock@dlr.de>
This commit is contained in:
parent
6d5d4e738c
commit
ee3ecb8ae2
3
setup.py
3
setup.py
@ -11,6 +11,7 @@ import string
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import io
|
||||||
|
|
||||||
import setuptools.command.sdist
|
import setuptools.command.sdist
|
||||||
|
|
||||||
@ -70,7 +71,7 @@ exec(code, loc)
|
|||||||
version = loc["__version__"]
|
version = loc["__version__"]
|
||||||
|
|
||||||
# Verify that the version matches the one in C++
|
# Verify that the version matches the one in C++
|
||||||
with open("include/pybind11/detail/common.h") as f:
|
with io.open("include/pybind11/detail/common.h", encoding="utf8") as f:
|
||||||
matches = dict(VERSION_REGEX.findall(f.read()))
|
matches = dict(VERSION_REGEX.findall(f.read()))
|
||||||
cpp_version = "{MAJOR}.{MINOR}.{PATCH}".format(**matches)
|
cpp_version = "{MAJOR}.{MINOR}.{PATCH}".format(**matches)
|
||||||
if version != cpp_version:
|
if version != cpp_version:
|
||||||
|
Loading…
Reference in New Issue
Block a user