Patchwork [STABLE] zstandard: pull in bug fixes from upstream 0.9.1 release (issue5884)

login
register
mail settings
Submitter Gregory Szorc
Date June 6, 2018, 4:14 p.m.
Message ID <c0081d3e1598e0c82cf5.1528301681@132.1.168.192.in-addr.arpa>
Download mbox | patch
Permalink /patch/31989/
State Accepted
Headers show

Comments

Gregory Szorc - June 6, 2018, 4:14 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1528301673 25200
#      Wed Jun 06 09:14:33 2018 -0700
# Branch stable
# Node ID c0081d3e1598e0c82cf5024422dc206db83687de
# Parent  3277940a935f499e5cb953ca17eebe5543470ca8
zstandard: pull in bug fixes from upstream 0.9.1 release (issue5884)

This changeset contains the meaningful code changes from
python-zstandard's 0.9.1 release. The main fix is to restore
support for compiling with mingw.
Augie Fackler - June 6, 2018, 4:25 p.m.
On Wed, Jun 06, 2018 at 09:14:41AM -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1528301673 25200
> #      Wed Jun 06 09:14:33 2018 -0700
> # Branch stable
> # Node ID c0081d3e1598e0c82cf5024422dc206db83687de
> # Parent  3277940a935f499e5cb953ca17eebe5543470ca8
> zstandard: pull in bug fixes from upstream 0.9.1 release (issue5884)

queued, thanks

Patch

diff --git a/contrib/python-zstandard/setup.py b/contrib/python-zstandard/setup.py
--- a/contrib/python-zstandard/setup.py
+++ b/contrib/python-zstandard/setup.py
@@ -32,9 +32,9 @@  if '--system-zstd' in sys.argv:
     sys.argv.remove('--system-zstd')
 
 if '--warnings-as-errors' in sys.argv:
     WARNINGS_AS_ERRORS = True
-    sys.argv.remote('--warning-as-errors')
+    sys.argv.remove('--warning-as-errors')
 
 # Code for obtaining the Extension instance is in its own module to
 # facilitate reuse in other projects.
 extensions = [
diff --git a/contrib/python-zstandard/setup_zstd.py b/contrib/python-zstandard/setup_zstd.py
--- a/contrib/python-zstandard/setup_zstd.py
+++ b/contrib/python-zstandard/setup_zstd.py
@@ -122,8 +122,10 @@  def get_c_extension(support_legacy=False
     if compiler.compiler_type == 'unix':
         compiler_type = 'unix'
     elif compiler.compiler_type == 'msvc':
         compiler_type = 'msvc'
+    elif compiler.compiler_type == 'mingw32':
+        compiler_type = 'mingw32'
     else:
         raise Exception('unhandled compiler type: %s' %
                         compiler.compiler_type)
 
@@ -140,9 +142,9 @@  def get_c_extension(support_legacy=False
     if not system_zstd and support_legacy:
         extra_args.append('-DZSTD_LEGACY_SUPPORT=1')
 
     if warnings_as_errors:
-        if compiler_type == 'unix':
+        if compiler_type in ('unix', 'mingw32'):
             extra_args.append('-Werror')
         elif compiler_type == 'msvc':
             extra_args.append('/WX')
         else: