aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-05-19 04:31:30 +0600
committerSergey M․ <dstftw@gmail.com>2016-05-19 04:31:30 +0600
commit46bc9b7d7cea2e161670e65abe42ef01d39e8957 (patch)
treeed0ae44e8dedebe282f8e2a06d8c97b67c69aae1 /youtube_dl/utils.py
parentb78531a36abd765aa9c9df1dba1cf82dc23f8fec (diff)
downloadyoutube-dl-46bc9b7d7cea2e161670e65abe42ef01d39e8957.tar.xz
[utils] Allow None in remove_{start,end}
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index ac60ba18c..5301d0740 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1549,15 +1549,11 @@ def setproctitle(title):
def remove_start(s, start):
- if s.startswith(start):
- return s[len(start):]
- return s
+ return s[len(start):] if s is not None and s.startswith(start) else s
def remove_end(s, end):
- if s.endswith(end):
- return s[:-len(end)]
- return s
+ return s[:-len(end)] if s is not None and s.endswith(end) else s
def remove_quotes(s):