[pitivi] pipeline: Fix new pylint w0707 issue



commit b679f6baf9d32534366356ad44301da8cd1eec94
Author: Thibault Saunier <tsaunier igalia com>
Date:   Mon Jan 11 17:48:34 2021 -0300

    pipeline: Fix new pylint w0707 issue
    
    Consider explicitly re-raising using the 'from' keyword

 pitivi/utils/pipeline.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/utils/pipeline.py b/pitivi/utils/pipeline.py
index 95be10659..857f46f21 100644
--- a/pitivi/utils/pipeline.py
+++ b/pitivi/utils/pipeline.py
@@ -225,7 +225,7 @@ class SimplePipeline(GObject.Object, Loggable):
             res, cur = self._pipeline.query_position(Gst.Format.TIME)
         except Exception as e:
             self.handle_exception(e)
-            raise PipelineError("Couldn't get position")
+            raise PipelineError("Couldn't get position") from e
 
         if res:
             self._last_position = cur
@@ -492,7 +492,7 @@ class SimplePipeline(GObject.Object, Loggable):
             res, dur = self._pipeline.query_duration(Gst.Format.TIME)
         except Exception as e:
             self.handle_exception(e)
-            raise PipelineError("Couldn't get duration: %s" % e)
+            raise PipelineError("Couldn't get duration") from e
 
         if not res:
             raise PipelineError("Couldn't get duration: Returned None")


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]