Skip to content

Commit

Permalink
Improve ~ in path handling in Video class
Browse files Browse the repository at this point in the history
  • Loading branch information
joaqo committed Sep 11, 2020
1 parent 37d4546 commit 64d7929
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion norfair/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(
# Read Input Video
if self.input_path is not None:
if "~" in self.input_path:
self._fail(f"[bold red]Error reading file:[/bold red] '{self.input_path}'\n[yellow]Using ~ as abbreviation for your home folder is not supported.[/yellow]")
self.input_path = os.path.expanduser(self.input_path)
if not os.path.isfile(self.input_path):
self._fail(f"[bold red]Error:[/bold red] File '{self.input_path}' does not exist.")
self.video_capture = cv2.VideoCapture(self.input_path)
Expand Down

0 comments on commit 64d7929

Please sign in to comment.