summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pyrfc3339/files/pyrfc3339-0.2-fixdoctests.patch')
-rw-r--r--dev-python/pyrfc3339/files/pyrfc3339-0.2-fixdoctests.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/dev-python/pyrfc3339/files/pyrfc3339-0.2-fixdoctests.patch b/dev-python/pyrfc3339/files/pyrfc3339-0.2-fixdoctests.patch
new file mode 100644
index 000000000000..1ce4cb02659a
--- /dev/null
+++ b/dev-python/pyrfc3339/files/pyrfc3339-0.2-fixdoctests.patch
@@ -0,0 +1,54 @@
+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