[PATCH] make build-many-glibcs.py work on python3.2

Joseph Myers joseph@codesourcery.com
Tue Nov 22 17:25:00 GMT 2016


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



More information about the Libc-alpha mailing list