[comedycentral] Support news-team URLs (Fixes #3649)
[youtube-dl] / youtube_dl / utils.py
index e07750434807a48d1f036b999503409b9a9cfa73..6fe05723484303839947357124fc9d9ebfadcf4e 100644 (file)
@@ -1141,10 +1141,10 @@ else:
     import fcntl
 
     def _lock_file(f, exclusive):
-        fcntl.lockf(f, fcntl.LOCK_EX if exclusive else fcntl.LOCK_SH)
+        fcntl.flock(f, fcntl.LOCK_EX if exclusive else fcntl.LOCK_SH)
 
     def _unlock_file(f):
-        fcntl.lockf(f, fcntl.LOCK_UN)
+        fcntl.flock(f, fcntl.LOCK_UN)
 
 
 class locked_file(object):
@@ -1318,6 +1318,7 @@ def str_or_none(v, default=None):
 
 
 def str_to_int(int_str):
+    """ A more relaxed version of int_or_none """
     if int_str is None:
         return None
     int_str = re.sub(r'[,\.]', u'', int_str)