diff options
| author | 2021-03-13 16:26:30 -0500 | |
|---|---|---|
| committer | 2021-03-13 16:26:30 -0500 | |
| commit | 3201d77a148367d739862b4f07868a76eaeb7cb1 (patch) | |
| tree | 78b8d71633ec000672a84ad0bbbddd0513ae2d30 /gallery_dl/downloader/__init__.py | |
| parent | fc83315c164afd74734adf27e0f7fec2011904aa (diff) | |
New upstream version 1.17.0.upstream/1.17.0
Diffstat (limited to 'gallery_dl/downloader/__init__.py')
| -rw-r--r-- | gallery_dl/downloader/__init__.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gallery_dl/downloader/__init__.py b/gallery_dl/downloader/__init__.py index 6fb09e1..e1b936e 100644 --- a/gallery_dl/downloader/__init__.py +++ b/gallery_dl/downloader/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2015-2019 Mike Fährmann +# Copyright 2015-2021 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -8,8 +8,6 @@ """Downloader modules""" -import importlib - modules = [ "http", "text", @@ -24,22 +22,22 @@ def find(scheme): except KeyError: pass - klass = None + cls = None if scheme == "https": scheme = "http" if scheme in modules: # prevent unwanted imports try: - module = importlib.import_module("." + scheme, __package__) + module = __import__(scheme, globals(), None, (), 1) except ImportError: pass else: - klass = module.__downloader__ + cls = module.__downloader__ if scheme == "http": - _cache["http"] = _cache["https"] = klass + _cache["http"] = _cache["https"] = cls else: - _cache[scheme] = klass - return klass + _cache[scheme] = cls + return cls # -------------------------------------------------------------------- |
