From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Petazzoni Date: Tue, 3 Dec 2019 21:00:38 +0100 Subject: [Buildroot] [PATCH buildroot-test] scripts/autobuild-run: make it Python 3.x compatible In-Reply-To: <20191203171137.7aqw4tjmx24fgnqm@sapphire.tkos.co.il> References: <20191203165457.1100390-1-thomas.petazzoni@bootlin.com> <20191203171137.7aqw4tjmx24fgnqm@sapphire.tkos.co.il> Message-ID: <20191203210038.348bd8bd@windsurf> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net Hello, On Tue, 3 Dec 2019 19:11:37 +0200 Baruch Siach wrote: > > - The urlparse module no longer exists, it's not urllib.parse > > s/not/now/ Indeed. > > if sys.hexversion >= 0x3000000: > > import configparser > > import urllib.request as _urllib > > + import urllib.parse as urlparse > > Would that work with any Python 3.x? https://docs.python.org/3/library/urllib.parse.html#module-urllib.parse has some comments in the documentation of urllib.parse.urlparse() that say: """ Changed in version 3.2: Added IPv6 URL parsing capabilities. """ So it means that urllib.parse.urlparse() was there at least before Python 3.2, which means it was most likely there since Python 3.x. Best regards, Thomas -- Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com