Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r77685:9738535f1376 Date: 2015-05-29 15:19 +0200 http://bitbucket.org/pypy/pypy/changeset/9738535f1376/
Log: merge heads diff --git a/lib_pypy/datetime.py b/lib_pypy/datetime.py --- a/lib_pypy/datetime.py +++ b/lib_pypy/datetime.py @@ -816,9 +816,9 @@ _MONTHNAMES[self._month], self._day, self._year) - def strftime(self, fmt): + def strftime(self, format): "Format using strftime()." - return _wrap_strftime(self, fmt, self.timetuple()) + return _wrap_strftime(self, format, self.timetuple()) def __format__(self, fmt): if not isinstance(fmt, (str, unicode)): @@ -1308,7 +1308,7 @@ __str__ = isoformat - def strftime(self, fmt): + def strftime(self, format): """Format using strftime(). The date part of the timestamp passed to underlying strftime should not be used. """ @@ -1317,7 +1317,7 @@ timetuple = (1900, 1, 1, self._hour, self._minute, self._second, 0, 1, -1) - return _wrap_strftime(self, fmt, timetuple) + return _wrap_strftime(self, format, timetuple) def __format__(self, fmt): if not isinstance(fmt, (str, unicode)): @@ -1497,7 +1497,7 @@ return self._tzinfo @classmethod - def fromtimestamp(cls, t, tz=None): + def fromtimestamp(cls, timestamp, tz=None): """Construct a datetime from a POSIX timestamp (like time.time()). A timezone info object may be passed in as well. @@ -1507,12 +1507,12 @@ converter = _time.localtime if tz is None else _time.gmtime - if isinstance(t, int): + if isinstance(timestamp, int): us = 0 else: - t_full = t - t = int(_math.floor(t)) - frac = t_full - t + t_full = timestamp + timestamp = int(_math.floor(timestamp)) + frac = t_full - timestamp us = _round(frac * 1e6) # If timestamp is less than one microsecond smaller than a @@ -1520,9 +1520,9 @@ # roll over to seconds, otherwise, ValueError is raised # by the constructor. if us == 1000000: - t += 1 + timestamp += 1 us = 0 - y, m, d, hh, mm, ss, weekday, jday, dst = converter(t) + y, m, d, hh, mm, ss, weekday, jday, dst = converter(timestamp) ss = min(ss, 59) # clamp out leap seconds if the platform has them result = cls(y, m, d, hh, mm, ss, us, tz) if tz is not None: _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit