diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2019-04-15 15:33:42 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-04-15 15:33:42 -0400 |
commit | fdaf03560138ab4188078bdfdfd1095c6961c106 (patch) | |
tree | 113f4f43e9e1b61a9452319df2e30ec609219538 /coverage/data.py | |
parent | 6c123704786e61cdca0bea6ecd89d01f499a0aa4 (diff) | |
download | python-coveragepy-git-fdaf03560138ab4188078bdfdfd1095c6961c106.tar.gz |
Fix #708: .filename is private, and don't combine over ourselves
Diffstat (limited to 'coverage/data.py')
-rw-r--r-- | coverage/data.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/coverage/data.py b/coverage/data.py index d6061293..f78628a5 100644 --- a/coverage/data.py +++ b/coverage/data.py @@ -710,7 +710,7 @@ def combine_parallel_data(data, aliases=None, data_paths=None, strict=False): """ # Because of the os.path.abspath in the constructor, data_dir will # never be an empty string. - data_dir, local = os.path.split(data.filename) + data_dir, local = os.path.split(data.base_filename()) localdot = local + '.*' data_paths = data_paths or [data_dir] @@ -729,6 +729,12 @@ def combine_parallel_data(data, aliases=None, data_paths=None, strict=False): files_combined = 0 for f in files_to_combine: + if f == data.filename(): + # Sometimes we are combining into a file which is one of the + # parallel files. Skip that file. + if data._debug.should('dataio'): + data._debug.write("Skipping combining ourself: %r" % (f,)) + continue if data._debug.should('dataio'): data._debug.write("Combining data file %r" % (f,)) try: |