mirror of https://github.com/python/cpython.git
merge
This commit is contained in:
commit
16b698b095
|
@ -3463,6 +3463,14 @@ def test_astimezone_default_eastern(self):
|
||||||
self.assertEqual(dt, local)
|
self.assertEqual(dt, local)
|
||||||
self.assertEqual(local.strftime("%z %Z"), "-0400 EDT")
|
self.assertEqual(local.strftime("%z %Z"), "-0400 EDT")
|
||||||
|
|
||||||
|
@support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0')
|
||||||
|
def test_astimezone_default_near_fold(self):
|
||||||
|
# Issue #26616.
|
||||||
|
u = datetime(2015, 11, 1, 5, tzinfo=timezone.utc)
|
||||||
|
t = u.astimezone()
|
||||||
|
s = t.astimezone()
|
||||||
|
self.assertEqual(t.tzinfo, s.tzinfo)
|
||||||
|
|
||||||
def test_aware_subtract(self):
|
def test_aware_subtract(self):
|
||||||
cls = self.theclass
|
cls = self.theclass
|
||||||
|
|
||||||
|
|
|
@ -232,6 +232,8 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #26616: Fixed a bug in datetime.astimezone() method.
|
||||||
|
|
||||||
- Issue #26637: The :mod:`importlib` module now emits an :exc:`ImportError`
|
- Issue #26637: The :mod:`importlib` module now emits an :exc:`ImportError`
|
||||||
rather than a :exc:`TypeError` if :func:`__import__` is tried during the
|
rather than a :exc:`TypeError` if :func:`__import__` is tried during the
|
||||||
Python shutdown process but :data:`sys.path` is already cleared (set to
|
Python shutdown process but :data:`sys.path` is already cleared (set to
|
||||||
|
|
|
@ -4753,7 +4753,12 @@ local_timezone(PyDateTime_DateTime *utc_time)
|
||||||
PyObject *nameo = NULL;
|
PyObject *nameo = NULL;
|
||||||
const char *zone = NULL;
|
const char *zone = NULL;
|
||||||
|
|
||||||
delta = datetime_subtract((PyObject *)utc_time, PyDateTime_Epoch);
|
delta = new_delta(ymd_to_ord(GET_YEAR(utc_time), GET_MONTH(utc_time),
|
||||||
|
GET_DAY(utc_time)) - 719163,
|
||||||
|
60 * (60 * DATE_GET_HOUR(utc_time) +
|
||||||
|
DATE_GET_MINUTE(utc_time)) +
|
||||||
|
DATE_GET_SECOND(utc_time),
|
||||||
|
0, 0);
|
||||||
if (delta == NULL)
|
if (delta == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
one_second = new_delta(0, 1, 0, 0);
|
one_second = new_delta(0, 1, 0, 0);
|
||||||
|
|
Loading…
Reference in New Issue