diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-06-29 20:52:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-29 20:52:55 +0300 |
commit | 4bfee181c5a166e3d429bd265e06d299dce50f30 (patch) | |
tree | 8918a0e09f668ed55748ec254c51b4d92b5403a9 /tools/cmake2meson.py | |
parent | 81ca0ec7ae975723b8b399b9f142286895a45dab (diff) | |
parent | c0a2025d038a08092212bfc45e7bbb46ff1e8e52 (diff) | |
download | meson-4bfee181c5a166e3d429bd265e06d299dce50f30.zip meson-4bfee181c5a166e3d429bd265e06d299dce50f30.tar.gz meson-4bfee181c5a166e3d429bd265e06d299dce50f30.tar.bz2 |
Merge pull request #8918 from mensinda/pathlibFixes
pathlib: Patch pathlib to work around some bugs (fixes #8263 #7295)
Diffstat (limited to 'tools/cmake2meson.py')
-rwxr-xr-x | tools/cmake2meson.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/cmake2meson.py b/tools/cmake2meson.py index 4185b5a..a12d9cf 100755 --- a/tools/cmake2meson.py +++ b/tools/cmake2meson.py @@ -280,13 +280,13 @@ class Converter: subdir = self.cmake_root cfile = Path(subdir).expanduser() / 'CMakeLists.txt' try: - with cfile.open() as f: + with cfile.open(encoding='utf-8') as f: cmakecode = f.read() except FileNotFoundError: print('\nWarning: No CMakeLists.txt in', subdir, '\n', file=sys.stderr) return p = Parser(cmakecode) - with (subdir / 'meson.build').open('w') as outfile: + with (subdir / 'meson.build').open('w', encoding='utf-8') as outfile: for t in p.parse(): if t.name == 'add_subdirectory': # print('\nRecursing to subdir', @@ -300,7 +300,7 @@ class Converter: def write_options(self) -> None: filename = self.cmake_root / 'meson_options.txt' - with filename.open('w') as optfile: + with filename.open('w', encoding='utf-8') as optfile: for o in self.options: (optname, description, default) = o if default is None: |