diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-07-25 23:37:32 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-07-25 23:37:32 +0200 |
commit | 11b85ce62ef8bafb6c459103ad4e95279dfb9dcb (patch) | |
tree | 546bac48ffc2d6d2666caa630db4037a1e284ded /youtube_dl/YoutubeDL.py | |
parent | 1220352ff72d3cb49a6e7cbc1097c8fb7bcb4c99 (diff) |
[YouTubeDL] Best practices (Closes #3370)
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rwxr-xr-x | youtube_dl/YoutubeDL.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index f295174cf..14a1d06ab 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -275,7 +275,7 @@ class YoutubeDL(object): return message assert hasattr(self, '_output_process') - assert type(message) == type('') + assert isinstance(message, compat_str) line_count = message.count('\n') + 1 self._output_process.stdin.write((message + '\n').encode('utf-8')) self._output_process.stdin.flush() @@ -303,7 +303,7 @@ class YoutubeDL(object): def to_stderr(self, message): """Print message to stderr.""" - assert type(message) == type('') + assert isinstance(message, compat_str) if self.params.get('logger'): self.params['logger'].error(message) else: @@ -849,7 +849,7 @@ class YoutubeDL(object): # Keep for backwards compatibility info_dict['stitle'] = info_dict['title'] - if not 'format' in info_dict: + if 'format' not in info_dict: info_dict['format'] = info_dict['ext'] reason = self._match_entry(info_dict) |