diff options
| author | Mikle Kolyada <zlogene@gentoo.org> | 2019-12-28 20:08:44 +0300 |
|---|---|---|
| committer | Mikle Kolyada <zlogene@gentoo.org> | 2019-12-28 20:08:51 +0300 |
| commit | 5511595e336f25098e0ab5f89de3eb73f9f582c8 (patch) | |
| tree | 109d50d1a909ae3e00feffacace661966b0d50df /dev-python/astropy/files/astropy-ply.py | |
| parent | 500fc1168e8da78811946a47d507e3cf364168fe (diff) | |
| download | gentoo-5511595e336f25098e0ab5f89de3eb73f9f582c8.tar.gz gentoo-5511595e336f25098e0ab5f89de3eb73f9f582c8.tar.bz2 gentoo-5511595e336f25098e0ab5f89de3eb73f9f582c8.zip | |
dev-python/astropy: remove last-rited pkg
Signed-off-by: Mikle Kolyada <zlogene@gentoo.org>
Diffstat (limited to 'dev-python/astropy/files/astropy-ply.py')
| -rw-r--r-- | dev-python/astropy/files/astropy-ply.py | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/dev-python/astropy/files/astropy-ply.py b/dev-python/astropy/files/astropy-ply.py deleted file mode 100644 index 19eb104c4ca0..000000000000 --- a/dev-python/astropy/files/astropy-ply.py +++ /dev/null @@ -1,58 +0,0 @@ -# Licensed under a 3-clause BSD style license - see LICENSE.rst - -""" -Handle loading ply package from system or from the bundled copy -""" - -import imp -from distutils.version import StrictVersion - - -def _find_module(name, path=None): - """ - Alternative to `imp.find_module` that can also search in subpackages. - """ - - parts = name.split('.') - - for part in parts: - if path is not None: - path = [path] - - fh, path, descr = imp.find_module(part, path) - - return fh, path, descr - -_PLY_MIN_VERSION = StrictVersion('3.4') - -# Update this to prevent Astropy from using its bundled copy of ply -# (but only if some other version of at least _PLY_MIN_VERSION can -# be provided) -_PLY_SEARCH_PATH = ['ply'] - - -for mod_name in _PLY_SEARCH_PATH: - try: - mod_info = _find_module(mod_name) - #mod_lex_info = _find_module(mod_name + '.lex') - except ImportError: - continue - - mod = imp.load_module(__name__, *mod_info) - #mod_lex = imp.load_module(__name__ + '.lex', *mod_lex_info) - - try: - # if StrictVersion(mod_lex.__version__) >= _PLY_MIN_VERSION: - # break - break - except (AttributeError, ValueError): - # Attribute error if the ply module isn't what it should be and doesn't - # have a .__version__; ValueError if the version string exists but is - # somehow bogus/unparseable - continue -else: - raise ImportError( - "Astropy requires the 'ply' module of minimum version {0}; " - "normally this is bundled with the astropy package so if you get " - "this warning consult the packager of your Astropy " - "distribution.".format(_PLY_MIN_VERSION)) |
