Author: Armin Rigo <ar...@tunes.org> Branch: py3.5 Changeset: r88728:6c1c69ada9bc Date: 2016-11-29 10:23 +0100 http://bitbucket.org/pypy/pypy/changeset/6c1c69ada9bc/
Log: hg merge default diff --git a/pypy/module/posix/interp_posix.py b/pypy/module/posix/interp_posix.py --- a/pypy/module/posix/interp_posix.py +++ b/pypy/module/posix/interp_posix.py @@ -484,7 +484,8 @@ def __init__(self, space): self.stat_float_times = True -def stat_float_times(space, w_value=None): +@unwrap_spec(newval=int) +def stat_float_times(space, newval=-1): """stat_float_times([newval]) -> oldval Determine whether os.[lf]stat represents time stamps as float objects. @@ -494,10 +495,10 @@ """ state = space.fromcache(StatState) - if w_value is None: + if newval == -1: return space.wrap(state.stat_float_times) else: - state.stat_float_times = space.bool_w(w_value) + state.stat_float_times = (newval != 0) @unwrap_spec(fd=c_int) diff --git a/pypy/module/posix/test/test_posix2.py b/pypy/module/posix/test/test_posix2.py --- a/pypy/module/posix/test/test_posix2.py +++ b/pypy/module/posix/test/test_posix2.py @@ -159,11 +159,14 @@ st = posix.stat(path) assert isinstance(st.st_mtime, float) assert st[7] == int(st.st_atime) + assert posix.stat_float_times(-1) is True posix.stat_float_times(False) st = posix.stat(path) assert isinstance(st.st_mtime, int) assert st[7] == st.st_atime + assert posix.stat_float_times(-1) is False + finally: posix.stat_float_times(current) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit