From 3bcdc8673a7e6c814880fbd77be67d2ce1eb104e 2014-01-28 18:28:04 From: Jonathan Frederic Date: 2014-01-28 18:28:04 Subject: [PATCH] A couple more small changes, also added __init__ file to new utils test dir --- diff --git a/IPython/nbconvert/utils/pandoc.py b/IPython/nbconvert/utils/pandoc.py index 15ef42e..af5568f 100644 --- a/IPython/nbconvert/utils/pandoc.py +++ b/IPython/nbconvert/utils/pandoc.py @@ -1,6 +1,6 @@ """Utility for calling pandoc""" #----------------------------------------------------------------------------- -# Copyright (c) 2013 the IPython Development Team. +# Copyright (c) 2014 the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # @@ -10,7 +10,6 @@ #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- - from __future__ import print_function # Stdlib imports @@ -24,7 +23,6 @@ from IPython.utils.py3compat import cast_bytes from IPython.utils.version import check_version from IPython.utils.process import is_cmd_found, FindCmdError - from .exceptions import ConversionException #----------------------------------------------------------------------------- @@ -84,16 +82,14 @@ def get_pandoc_version(): """ global __version - if __version is not None: - return __version - else: + if __version is None: if not is_cmd_found('pandoc'): raise PandocMissing() out = subprocess.check_output( ['pandoc', '-v'], universal_newlines=True) pv_re = re.compile(r'(\d{0,3}\.\d{0,3}\.\d{0,3})') __version = pv_re.search(out).group(0) - return __version + return __version def check_pandoc_version(): @@ -130,6 +126,3 @@ def clean_cache(): __version = None __version = None - - - diff --git a/IPython/nbconvert/utils/tests/__init__.py b/IPython/nbconvert/utils/tests/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/IPython/nbconvert/utils/tests/__init__.py diff --git a/IPython/nbconvert/utils/tests/test_pandoc.py b/IPython/nbconvert/utils/tests/test_pandoc.py index f8faad2..9a530e8 100644 --- a/IPython/nbconvert/utils/tests/test_pandoc.py +++ b/IPython/nbconvert/utils/tests/test_pandoc.py @@ -1,5 +1,4 @@ """Test Pandoc module""" - #----------------------------------------------------------------------------- # Copyright (C) 2014 The IPython Development Team #