Index: zenmap/zenmapCore/NmapParser.py =================================================================== --- zenmap/zenmapCore/NmapParser.py (revision 32983) +++ zenmap/zenmapCore/NmapParser.py (working copy) @@ -125,9 +125,15 @@ import os.path import time import socket -import StringIO import copy +# Use the faster cStringIO if available, fallback on StringIO if not +try: + import cStringIO + StringIO = cStringIO +except ImportError: + import StringIO + # Prevent loading PyXML import xml xml.__path__ = [x for x in xml.__path__ if "_xmlplus" not in x] @@ -503,7 +509,8 @@ def set_nmap_output(self, nmap_output): self._nmap_output.close() del self._nmap_output - self._nmap_output = StringIO.StringIO(nmap_output) + self._nmap_output = StringIO.StringIO() + self._nmap_output.write(nmap_output) def del_nmap_output(self): self._nmap_output.close()