Blame 7.patch

307e668
From 46b2192c1c146bffda04ffe696a8934015af5777 Mon Sep 17 00:00:00 2001
307e668
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
307e668
Date: Mon, 13 May 2019 10:48:03 +0200
307e668
Subject: [PATCH] Build docs with Python 3
307e668
307e668
Fixes https://github.com/WoLpH/python-utils/issues/6
307e668
---
307e668
 docs/conf.py | 4 +++-
307e668
 tox.ini      | 2 +-
307e668
 2 files changed, 4 insertions(+), 2 deletions(-)
307e668
307e668
diff --git a/docs/conf.py b/docs/conf.py
307e668
index 6f1ccba..f2225c5 100644
307e668
--- a/docs/conf.py
307e668
+++ b/docs/conf.py
307e668
@@ -67,7 +67,7 @@
307e668
 
307e668
 # Monkey patch to disable nonlocal image warning
307e668
 import sphinx
307e668
-if hasattr(sphinx, 'environment'):
307e668
+try:
307e668
     original_warn_mode = sphinx.environment.BuildEnvironment.warn_node
307e668
 
307e668
     def allow_nonlocal_image_warn_node(self, msg, *args, **kwargs):
307e668
@@ -76,6 +76,8 @@ def allow_nonlocal_image_warn_node(self, msg, *args, **kwargs):
307e668
 
307e668
     sphinx.environment.BuildEnvironment.warn_node = \
307e668
         allow_nonlocal_image_warn_node
307e668
+except AttributeError:
307e668
+    pass
307e668
 
307e668
 suppress_warnings = [
307e668
     'image.nonlocal_uri',
307e668
diff --git a/tox.ini b/tox.ini
307e668
index 33b165c..b588f0a 100644
307e668
--- a/tox.ini
307e668
+++ b/tox.ini
307e668
@@ -19,7 +19,7 @@ deps = flake8
307e668
 commands = flake8 --ignore=W391 python_utils {posargs}
307e668
 
307e668
 [testenv:docs]
307e668
-basepython = python2.7
307e668
+basepython = python3
307e668
 whitelist_externals =
307e668
     rm
307e668
     cd