This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] make build-many-glibcs.py work on python3.2
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, <nd at arm dot com>
- Date: Tue, 22 Nov 2016 17:24:46 +0000
- Subject: Re: [PATCH] make build-many-glibcs.py work on python3.2
- Authentication-results: sourceware.org; auth=none
- References: <58344D35.7080506@arm.com>
On Tue, 22 Nov 2016, Szabolcs Nagy wrote:
> +try:
> + os.cpu_count
> +except:
> + os.cpu_count = lambda: 1
multiprocessing.cpu_count may be a better fallback.
> +try:
> + re.fullmatch
> +except:
> + re.fullmatch = lambda p,s,f=0: re.match("^"+p+"$",s,f)
You don't need the ^ since match means match at the start of the string.
And \Z corresponds more accurately to fullmatch semantics than $.
(I think the principle of including such compatibility code is fine if
people want to use the script with older Python 3.x. I don't have
anything older than 3.4 (the version on Ubuntu 14.04) to hand for testing
such compatibility code myself.)
--
Joseph S. Myers
joseph@codesourcery.com