Commit 85a09744 by Timothée Peignier

use concurrent.futures to be compatible with python3

parent d7021669
......@@ -4,7 +4,7 @@ import multiprocessing
import os
import subprocess
from multiprocessing.pool import ThreadPool
from concurrent import futures
from django.contrib.staticfiles import finders
from django.core.files.base import ContentFile
......@@ -20,7 +20,7 @@ class Compiler(object):
def __init__(self, storage=default_storage, verbose=False):
self.storage = storage
self.verbose = verbose
self.pool = ThreadPool(processes=multiprocessing.cpu_count())
self.executor = futures.ThreadPoolExecutor(max_workers=multiprocessing.cpu_count())
@property
def compilers(self):
......@@ -47,7 +47,7 @@ class Compiler(object):
return output_path
else:
return input_path
return self.pool.map(_compile, paths)
return self.executor.map(_compile, paths)
def output_path(self, path, extension):
path = os.path.splitext(path)
......
......@@ -14,6 +14,10 @@ setup(
license='MIT',
packages=find_packages(),
zip_safe=False,
install_requires=[
'futures>=2.1.3',
'Django>=1.4.2'
],
include_package_data=True,
classifiers=[
'Environment :: Web Environment',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment