Private GIT

Skip to content
Snippets Groups Projects
Commit 271c94a7 authored by miigotu's avatar miigotu
Browse files

Merge pull request #149 from SickRage/unicode2

Remove asserts
parents 53d34d3e a26f7551
No related branches found
No related tags found
No related merge requests found
......@@ -948,8 +948,8 @@ def create_https_certificates(ssl_cert, ssl_key):
:return: True on success, False on failure
"""
assert isinstance(ssl_key, unicode)
assert isinstance(ssl_cert, unicode)
# assert isinstance(ssl_key, unicode)
# assert isinstance(ssl_cert, unicode)
try:
from OpenSSL import crypto # @UnresolvedImport
......@@ -1094,7 +1094,7 @@ def md5_for_file(filename, block_size=2 ** 16):
:return MD5 hexdigest on success, or None on failure
"""
assert isinstance(filename, unicode)
# assert isinstance(filename, unicode)
try:
with io.open(filename, 'rb') as f:
......@@ -1559,6 +1559,8 @@ def _setUpSession(session, headers):
session = CacheControl(sess=session, cache=caches.FileCache(os.path.join(cache_dir, 'sessions'), use_dir_lock=True), cache_etags=False)
# request session clear residual referer
# pylint: disable=C0325
# These extra parens are necessary!
if 'Referer' in session.headers and 'Referer' not in (headers or {}):
session.headers.pop('Referer')
......@@ -1871,10 +1873,9 @@ def isFileLocked(checkfile, writeLockCheck=False):
:param writeLockCheck: when true will check if the file is locked for writing (prevents move operations)
"""
checkfile = os.path.abspath(checkfile)
assert isinstance(checkfile, unicode)
checkfile = ek(os.path.abspath, checkfile)
if not os.path.exists(checkfile):
if not ek(os.path.exists, checkfile):
return True
try:
f = io.open(checkfile, 'rb')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment