diff options
Diffstat (limited to 'Lib/test/libregrtest')
-rw-r--r-- | Lib/test/libregrtest/main.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index 85bf6e1..cc8ba05 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -600,6 +600,16 @@ class Regrtest: for s in ET.tostringlist(root): f.write(s) + def fix_umask(self): + if support.is_emscripten: + # Emscripten has default umask 0o777, which breaks some tests. + # see https://github.com/emscripten-core/emscripten/issues/17269 + old_mask = os.umask(0) + if old_mask == 0o777: + os.umask(0o027) + else: + os.umask(old_mask) + def set_temp_dir(self): if self.ns.tempdir: self.tmp_dir = self.ns.tempdir @@ -660,6 +670,8 @@ class Regrtest: self.set_temp_dir() + self.fix_umask() + if self.ns.cleanup: self.cleanup() sys.exit(0) |