forked from pool/python-Sphinx
https://bitbucket.org/birkenfeld/sphinx/pull-request/193/ OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Sphinx?expand=0&rev=45
32 lines
1.1 KiB
Diff
32 lines
1.1 KiB
Diff
diff -r 86e59496553b sphinx/setup_command.py
|
|
--- a/sphinx/setup_command.py Tue Nov 12 15:17:09 2013 +0000
|
|
+++ b/sphinx/setup_command.py Wed Nov 13 15:41:12 2013 +0100
|
|
@@ -14,6 +14,7 @@
|
|
|
|
import sys
|
|
import os
|
|
+import types
|
|
from StringIO import StringIO
|
|
from distutils.cmd import Command
|
|
|
|
@@ -98,6 +99,19 @@
|
|
return root
|
|
return None
|
|
|
|
+ # Overriding distutils' Command._ensure_stringlike which doesn't support
|
|
+ # unicode, causing finalize_options to fail if invoked again. Workaround
|
|
+ # for http://bugs.python.org/issue19570
|
|
+ def _ensure_stringlike(self, option, what, default=None):
|
|
+ val = getattr(self, option)
|
|
+ if val is None:
|
|
+ setattr(self, option, default)
|
|
+ return default
|
|
+ elif not isinstance(val, types.StringTypes):
|
|
+ raise DistutilsOptionError("'%s' must be a %s (got `%s`)"
|
|
+ % (option, what, val))
|
|
+ return val
|
|
+
|
|
def finalize_options(self):
|
|
if self.source_dir is None:
|
|
self.source_dir = self._guess_source_dir()
|