[pypy-commit] pypy default: Fix the keyword argument names that differ from CPython
arigo
noreply at buildbot.pypy.org
Fri May 29 15:19:43 CEST 2015
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r77684:db719ce5b1f5
Date: 2015-05-29 14:19 +0100
http://bitbucket.org/pypy/pypy/changeset/db719ce5b1f5/
Log: Fix the keyword argument names that differ from CPython
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:
More information about the pypy-commit
mailing list