* [gentoo-commits] gentoo-x86 commit in dev-python/pyrfc3339/files: pyrfc3339-0.2-fixdoctests.patch
@ 2015-08-08 13:43 Manuel Rueger (mrueg)
0 siblings, 0 replies; only message in thread
From: Manuel Rueger (mrueg) @ 2015-08-08 13:43 UTC (permalink / raw
To: gentoo-commits
mrueg 15/08/08 13:43:28
Added: pyrfc3339-0.2-fixdoctests.patch
Log:
Initial version.
(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key )
Revision Changes Path
1.1 dev-python/pyrfc3339/files/pyrfc3339-0.2-fixdoctests.patch
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pyrfc3339/files/pyrfc3339-0.2-fixdoctests.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-python/pyrfc3339/files/pyrfc3339-0.2-fixdoctests.patch?rev=1.1&content-type=text/plain
Index: pyrfc3339-0.2-fixdoctests.patch
===================================================================
From 085006c9ffc00d3fba3b91eb33111c791a592715 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Manuel=20R=C3=BCger?= <mrueg@rueg.eu>
Date: Mon, 13 Jul 2015 20:49:51 +0200
Subject: [PATCH] Fix doctests for python3
---
pyrfc3339/generator.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/pyrfc3339/generator.py b/pyrfc3339/generator.py
index 020d47b..62f88e0 100644
--- a/pyrfc3339/generator.py
+++ b/pyrfc3339/generator.py
@@ -9,7 +9,7 @@ def generate(dt, utc=True, accept_naive=False, microseconds=False):
:class:`datetime.datetime`.
>>> from datetime import datetime
- >>> generate(datetime(2009,01,01,12,59,59,0,pytz.utc))
+ >>> generate(datetime(2009,1,1,12,59,59,0,pytz.utc))
'2009-01-01T12:59:59Z'
The timestamp will use UTC unless `utc=False` is specified, in which case
@@ -17,7 +17,7 @@ def generate(dt, utc=True, accept_naive=False, microseconds=False):
:attr:`tzinfo` parameter.
>>> eastern = pytz.timezone('US/Eastern')
- >>> dt = eastern.localize(datetime(2009,01,01,12,59,59))
+ >>> dt = eastern.localize(datetime(2009,1,1,12,59,59))
>>> generate(dt)
'2009-01-01T17:59:59Z'
>>> generate(dt, utc=False)
@@ -25,19 +25,19 @@ def generate(dt, utc=True, accept_naive=False, microseconds=False):
Unless `accept_naive=True` is specified, the `datetime` must not be naive.
- >>> generate(datetime(2009,01,01,12,59,59,0))
+ >>> generate(datetime(2009,1,1,12,59,59,0))
Traceback (most recent call last):
...
ValueError: naive datetime and accept_naive is False
- >>> generate(datetime(2009,01,01,12,59,59,0), accept_naive=True)
+ >>> generate(datetime(2009,1,1,12,59,59,0), accept_naive=True)
'2009-01-01T12:59:59Z'
If `accept_naive=True` is specified, the `datetime` is assumed to be UTC.
Attempting to generate a local timestamp from a naive datetime will result
in an error.
- >>> generate(datetime(2009,01,01,12,59,59,0), accept_naive=True, utc=False)
+ >>> generate(datetime(2009,1,1,12,59,59,0), accept_naive=True, utc=False)
Traceback (most recent call last):
...
ValueError: cannot generate a local timestamp from a naive datetime
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-08-08 13:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-08 13:43 [gentoo-commits] gentoo-x86 commit in dev-python/pyrfc3339/files: pyrfc3339-0.2-fixdoctests.patch Manuel Rueger (mrueg)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox