This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]