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 /mesonbuild/scripts/depscan.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 'mesonbuild/scripts/depscan.py')
-rw-r--r-- | mesonbuild/scripts/depscan.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/scripts/depscan.py b/mesonbuild/scripts/depscan.py index 207bbc6..9fc435b 100644 --- a/mesonbuild/scripts/depscan.py +++ b/mesonbuild/scripts/depscan.py @@ -57,7 +57,7 @@ class DependencyScanner: def scan_fortran_file(self, fname: str) -> None: fpath = pathlib.Path(fname) modules_in_this_file = set() - for line in fpath.read_text().split('\n'): + for line in fpath.read_text(encoding='utf-8').split('\n'): import_match = FORTRAN_USE_RE.match(line) export_match = FORTRAN_MODULE_RE.match(line) submodule_export_match = FORTRAN_SUBMOD_RE.match(line) @@ -108,7 +108,7 @@ class DependencyScanner: def scan_cpp_file(self, fname: str) -> None: fpath = pathlib.Path(fname) - for line in fpath.read_text().split('\n'): + for line in fpath.read_text(encoding='utf-8').split('\n'): import_match = CPP_IMPORT_RE.match(line) export_match = CPP_EXPORT_RE.match(line) if import_match: @@ -150,7 +150,7 @@ class DependencyScanner: def scan(self) -> int: for s in self.sources: self.scan_file(s) - with open(self.outfile, 'w') as ofile: + with open(self.outfile, 'w', encoding='utf-8') as ofile: ofile.write('ninja_dyndep_version = 1\n') for src in self.sources: objfilename = self.objname_for(src) |