Changeset d5c572b in mod_gnutls


Ignore:
Timestamp:
Dec 19, 2019, 6:26:30 AM (9 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
master, proxy-ticket
Children:
45b0a24
Parents:
3be92d3
git-author:
Fiona Klute <fiona.klute@…> (12/19/19 05:28:55)
git-committer:
Fiona Klute <fiona.klute@…> (12/19/19 06:26:30)
Message:

Use try/finally in lockfile context even when locking is disabled

The simple "yield" caused exceptions with contextlib.ExitStack?().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/mgstest/__init__.py

    r3be92d3 rd5c572b  
    3939    """
    4040    if nolock:
    41         yield
     41        try:
     42            yield None
     43        finally:
     44            pass
    4245    else:
    4346        with open(file, 'w') as lockfile:
     
    4649                fcntl.flock(lockfile, fcntl.LOCK_EX)
    4750                print(f'Got lock on {file}.', file=sys.stderr)
    48                 yield
     51                yield lockfile
    4952            finally:
    5053                print(f'Unlocking {file}...', file=sys.stderr)
Note: See TracChangeset for help on using the changeset viewer.