Description: Remove dependency on the Python profiler
 This patch removes the need for a package dependency on python-profiler,
 which is no longer available in Debian.
Author: Jeff Licquia <licquia@debian.org>
Forwarded: not-needed
Last-Update: 2018-05-13
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/manlifter
+++ b/manlifter
@@ -6,7 +6,10 @@
 # SPDX-License-Identifier: BSD-2-Clause
 
 import sys, os, getopt, signal, time, re, subprocess, cStringIO, stat
-import hotshot, hotshot.stats
+try:
+    import hotshot, hotshot.stats
+except ImportError:
+    hotshot = False
 
 try:
     getstatusoutput = subprocess.getstatusoutput
@@ -705,7 +708,7 @@
     # Gather options
     (options, arguments) = getopt.getopt(sys.argv[1:], "d:ef:hI:mMp:Pqs:SvwX:")
     # Do the real work
-    if "-P" in sys.argv:
+    if "-P" in sys.argv and hotshot:
         prof = hotshot.Profile("manlifter.prof")
         prof.runcall(doclifter_driver, options, arguments)
         prof.close()
