From cf252ef0d9ffa164302d7510eec82961be4d7bd2 Mon Sep 17 00:00:00 2001 From: zooko <zooko@zooko.com> Date: Wed, 11 Apr 2012 08:37:20 +0530 Subject: [PATCH] setup: require the argparse distribution only if the argparse module can't be imported Ignore-this: 82585d4def974c5bddfaf396b102897a darcs-hash:43bb318dee3ff378a947e68aa4539877297e361e --- zfec/setup.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/zfec/setup.py b/zfec/setup.py index fdb6785..bd0cbc7 100755 --- a/zfec/setup.py +++ b/zfec/setup.py @@ -1,9 +1,7 @@ -#!/usr/bin/env python - + # zfec -- fast forward error correction library with Python interface # -# Copyright (C) 2007-2011 Allmydata, Inc. -# Author: Zooko Wilcox-O'Hearn +# copyright © 2007-2012 Zooko Wilcox-O'Hearn # # This file is part of zfec. # @@ -153,7 +151,12 @@ if readmetext[:3] == '\xef\xbb\xbf': install_requires=["pyutil >= 1.3.19"] -if sys.version_info < (2, 7): +# argparse comes built into Python >= 2.7, and is provided by the "argparse" +# distribution for earlier versions of Python. +try: + import argparse + argparse # hush pyflakes +except ImportError: install_requires.append("argparse >= 0.8") setup(name=PKG, -- 2.45.2