@unittest.skip('TODO: RUSTPYTHON')
@util.writes_bytecode_files
def test_timestamp_overflow(self):
    with util.create_modules('_temp') as mapping:
        source = mapping['_temp']
        compiled = self.util.cache_from_source(source)
        with open(source, 'w') as f:
            f.write('x = 5')
        try:
            os.utime(source, (((2 ** 33) - 5), ((2 ** 33) - 5)))
        except OverflowError:
            self.skipTest('cannot set modification time to large integer')
        except OSError as e:
            if (e.errno != getattr(errno, 'EOVERFLOW', None)):
                raise
            self.skipTest('cannot set modification time to large integer ({})'.format(e))
        loader = self.machinery.SourceFileLoader('_temp', mapping['_temp'])
        module = types.ModuleType('_temp')
        module.__spec__ = self.util.spec_from_loader('_temp', loader)
        loader.exec_module(module)
        self.assertEqual(module.x, 5)
        self.assertTrue(os.path.exists(compiled))
        os.unlink(compiled)
        with warnings.catch_warnings():
            warnings.simplefilter('ignore', DeprecationWarning)
            mod = loader.load_module('_temp')
        self.assertEqual(mod.__cached__, compiled)
        self.assertEqual(mod.x, 5)
        self.assertTrue(os.path.exists(compiled))
@unittest.skip('TODO: RUSTPYTHON')
@util.writes_bytecode_files
def test_timestamp_overflow(self):
    with util.create_modules('_temp') as mapping:
        source = mapping['_temp']
        compiled = self.util.cache_from_source(source)
        with open(source, 'w') as f:
            f.write('x = 5')
        try:
            os.utime(source, (((2 ** 33) - 5), ((2 ** 33) - 5)))
        except OverflowError:
            self.skipTest('cannot set modification time to large integer')
        except OSError as e:
            if (e.errno != getattr(errno, 'EOVERFLOW', None)):
                raise
            self.skipTest('cannot set modification time to large integer ({})'.format(e))
        loader = self.machinery.SourceFileLoader('_temp', mapping['_temp'])
        module = types.ModuleType('_temp')
        module.__spec__ = self.util.spec_from_loader('_temp', loader)
        loader.exec_module(module)
        self.assertEqual(module.x, 5)
        self.assertTrue(os.path.exists(compiled))
        os.unlink(compiled)
        with warnings.catch_warnings():
            warnings.simplefilter('ignore', DeprecationWarning)
            mod = loader.load_module('_temp')
        self.assertEqual(mod.__cached__, compiled)
        self.assertEqual(mod.x, 5)
        self.assertTrue(os.path.exists(compiled))