You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by al...@apache.org on 2019/09/17 21:19:34 UTC

[beam] branch master updated: Fix traceback.format_exc(e) calls

This is an automated email from the ASF dual-hosted git repository.

altay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 510427e  Fix traceback.format_exc(e) calls
     new 4aad615  Merge pull request #9599 from Pehat/patch-1
510427e is described below

commit 510427eebdea32e411e23f565efe5916ec1c9691
Author: Renat Nasyrov <re...@yandex.ru>
AuthorDate: Tue Sep 17 20:17:52 2019 +0200

    Fix traceback.format_exc(e) calls
    
    As of https://docs.python.org/2/library/traceback.html#traceback.format_exc , `format_exc()` accepts an integer for traceback depth limit, not the traceback itself.
---
 sdks/python/apache_beam/io/vcfio.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sdks/python/apache_beam/io/vcfio.py b/sdks/python/apache_beam/io/vcfio.py
index 0ce76bd..9f13b8b 100644
--- a/sdks/python/apache_beam/io/vcfio.py
+++ b/sdks/python/apache_beam/io/vcfio.py
@@ -344,12 +344,12 @@ class _VcfSource(filebasedsource.FileBasedSource):
         record = next(self._vcf_reader)
         return self._convert_to_variant_record(record, self._vcf_reader.infos,
                                                self._vcf_reader.formats)
-      except (LookupError, ValueError) as e:
+      except (LookupError, ValueError):
         if self._allow_malformed_records:
           logging.warning(
               'An exception was raised when reading record from VCF file '
               '%s. Invalid record was %s: %s',
-              self._file_name, self._last_record, traceback.format_exc(e))
+              self._file_name, self._last_record, traceback.format_exc())
           return MalformedVcfRecord(self._file_name, self._last_record)
 
         # Throw the exception inside the generator to ensure file is properly
@@ -359,7 +359,7 @@ class _VcfSource(filebasedsource.FileBasedSource):
                        'file %s. Invalid record was %s: %s' % (
                            self._file_name,
                            self._last_record,
-                           traceback.format_exc(e))))
+                           traceback.format_exc())))
 
     def _convert_to_variant_record(self, record, infos, formats):
       """Converts the PyVCF record to a :class:`Variant` object.