import os
import svn.local

def test_helper():
    return "test helper text"

def file_contents(filename, label=None):
    """
    Helper function for getting the contents of a file,
    provided the filename.
    
    Returns a dictionary keyed (by default) with the filename
    where the value is a string containing the contents of the file.
    
    The optional argument 'label' allows you to set the 
    string used as the dictionary key in the returned dictionary.
    """
    if not os.path.isfile(filename):
        print('ERROR: {} NOT FOUND.'.format(filename))
        return {}
    else:
        fin = open(filename, 'r')
        contents = ''
        for l in fin:
            contents += l
        if label:
            d = {'{}'.format(label): contents}
        else:
            d = {filename: contents}
        return d

def svn_information(svndir=None, label=None):
    """
    Helper function for obtaining the SVN repository
    information for the current directory (default)
    or the directory supplied in the svndir argument.
    
    Returns a dictionary keyed (by default) as 'SVN INFO'
    where the value is a string containing essentially what
    is returned by 'svn info'.
    
    The optional argument 'label' allows you to set the 
    string used as the dictionary key in the returned dictionary.
    """
    if svndir:
        repo = svn.local.LocalClient(svndir)
    else:
        repo = svn.local.LocalClient(os.getcwd())
    try:
        # Get a dictionary of the SVN repository information
        info = repo.info()
    except:
        print('ERROR: WORKING DIRECTORY NOT AN SVN REPOSITORY.')
        return {}
    vals = []
    for k in info.keys():
        vals.append('{}: {}'.format(k, info[k]))
    v = '\n'.join(vals)
    if label:
        k = '{}'.format(label)
    else:
        k = 'SVN INFO'
    return {k: v}

@@ -3,16 +3,26 @@
 port os%0A
+%0Atry:%0A    
 import s
@@ -29,16 +29,77 @@
 vn.local
+%0A    _has_svn_local = True%0Aexcept:%0A    _has_svn_local = False
 %0A%0Adef te
@@ -1403,24 +1403,241 @@
 ry.%0A    %22%22%22%0A
+    if not _has_svn_local:%0A        print('SVN information unavailable.')%0A        print('You do not have the %22svn%22 package installed.')%0A        print('Install %22svn%22 from pip using %22pip install svn%22')%0A        return %7B%7D%0A
     if svndi

Put svn import into a try-except block.