From: Thomas Perrot <[email protected]> The import was duplicated inside both latest_versionstring() and latest_versionstring_from_index(). Move it to the top of the module.
Signed-off-by: Thomas Perrot <[email protected]> --- lib/bb/fetch2/crate.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/bb/fetch2/crate.py b/lib/bb/fetch2/crate.py index eb1fd5719e8c..b46d4f1a9801 100644 --- a/lib/bb/fetch2/crate.py +++ b/lib/bb/fetch2/crate.py @@ -14,6 +14,7 @@ import hashlib import json import os import subprocess +from functools import cmp_to_key import bb from bb.fetch2 import logger, subprocess_setup, UnpackError from bb.fetch2.wget import Wget @@ -159,7 +160,6 @@ class Crate(Wget): """ Return the latest version available when versionsurl is the [name]/versions URL. """ - from functools import cmp_to_key json_data = json.loads(self._fetch_index(ud.versionsurl, ud, d)) versions = [(0, i["num"], "") for i in json_data["versions"]] versions = sorted(versions, key=cmp_to_key(bb.utils.vercmp)) @@ -172,8 +172,6 @@ class Crate(Wget): file. https://doc.rust-lang.org/cargo/reference/registry-index.html#index-files """ - from functools import cmp_to_key - versions = [] response = self._fetch_index(ud.versionsurl, ud, d) for line in response.splitlines(): -- 2.54.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#236594): https://lists.openembedded.org/g/openembedded-core/message/236594 Mute This Topic: https://lists.openembedded.org/mt/119197966/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
