From: zooko Date: Wed, 11 Apr 2012 03:07:20 +0000 (+0530) Subject: setup: require the argparse distribution only if the argparse module can't be imported X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/file/URI:LIT:krugkidfnzsc4/%22file:/something?a=commitdiff_plain;h=cf252ef0d9ffa164302d7510eec82961be4d7bd2;p=tahoe-lafs%2Fzfec.git setup: require the argparse distribution only if the argparse module can't be imported Ignore-this: 82585d4def974c5bddfaf396b102897a darcs-hash:43bb318dee3ff378a947e68aa4539877297e361e --- 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,