# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1311393459 -7200
#      Sat Jul 23 05:57:39 2011 +0200
# Node ID c3a6ec30405510641033983dcd63543ed9f99509
# Parent  1470f8b0069428ee587ec9255af58bcca6267638
setup: subclass distribution instead of overwriting original

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -221,9 +221,13 @@
 # when build_py is run next.
 build.sub_commands.insert(0, ('build_mo', None))
 
-Distribution.pure = 0
-Distribution.global_options.append(('pure', None, "use pure (slow) Python "
-                                    "code instead of C extensions"))
+class hgdist(Distribution):
+    pure = 0
+
+    global_options = Distribution.global_options + \
+                     [('pure', None, "use pure (slow) Python "
+                        "code instead of C extensions"),
+                     ]
 
 class hgbuildext(build_ext):
 
@@ -435,6 +439,7 @@
       data_files=datafiles,
       package_data=packagedata,
       cmdclass=cmdclass,
+      distclass=hgdist,
       options=dict(py2exe=dict(packages=['hgext', 'email']),
                    bdist_mpkg=dict(zipdist=True,
                                    license='COPYING',