mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-44129: Add descriptive global variables for general purpose bit flags (GH-26118)
Replace hex flag masks with named global variables to improve readability. eg. if flags & 0x800 becomes: if flags & _MASK_UTF_FILENAME
This commit is contained in:
parent
a79e2b6497
commit
556d5ad11f
2 changed files with 39 additions and 13 deletions
|
@ -1545,7 +1545,7 @@ class OtherTests(unittest.TestCase):
|
|||
with zipfile.ZipFile(TESTFN2, 'w') as orig_zip:
|
||||
for data in 'abcdefghijklmnop':
|
||||
zinfo = zipfile.ZipInfo(data)
|
||||
zinfo.flag_bits |= 0x08 # Include an extended local header.
|
||||
zinfo.flag_bits |= zipfile._MASK_USE_DATA_DESCRIPTOR # Include an extended local header.
|
||||
orig_zip.writestr(zinfo, data)
|
||||
|
||||
def test_close(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue