Chromium Code Reviews| Index: mojo/devtools/common/devtoolslib/http_server.py |
| diff --git a/mojo/devtools/common/devtoolslib/http_server.py b/mojo/devtools/common/devtoolslib/http_server.py |
| index d8a275770135205263026d3cba56a3aa733ddf77..7c04174fe34828381b67dfe988a6228f2f1649bb 100644 |
| --- a/mojo/devtools/common/devtoolslib/http_server.py |
| +++ b/mojo/devtools/common/devtoolslib/http_server.py |
| @@ -6,15 +6,14 @@ import atexit |
| import datetime |
| import email.utils |
| import errno |
| -import gzip |
| import hashlib |
| import logging |
| import math |
| import os.path |
| -import shutil |
| import socket |
| -import threading |
| +import subprocess |
| import tempfile |
| +import threading |
| import SimpleHTTPServer |
| import SocketServer |
| @@ -155,9 +154,8 @@ def _get_handler_class_for_path(mappings): |
| if not self.gzipped_file: |
| self.gzipped_file = tempfile.NamedTemporaryFile(delete=False) |
| self.original_file_name = candidate |
| - with open(candidate, 'rb') as source: |
| - with gzip.GzipFile(fileobj=self.gzipped_file) as target: |
| - shutil.copyfileobj(source, target) |
| + subprocess.check_call(['gzip', '-c', candidate], |
|
piotrt
2015/08/25 09:23:36
Maybe it would be good to handle errors here? the
ppi
2015/08/25 11:34:36
Done.
|
| + stdout=self.gzipped_file) |
| self.gzipped_file.close() |
| return self.gzipped_file.name |
| return candidate |