Apply Python 3 futurize transform libmodernize.fixes.fix_basestring

Refer to #256
This commit is contained in:
Eklavya Sharma 2016-03-10 22:43:01 +05:30 committed by Tim Abbott
parent 37365ba5a3
commit 6e69c1447a
2 changed files with 6 additions and 2 deletions

View file

@ -26,6 +26,7 @@
# or preferably on a server. # or preferably on a server.
# You may need to install the python-requests library. # You may need to install the python-requests library.
from __future__ import absolute_import
import requests import requests
import logging import logging
import time import time
@ -34,6 +35,7 @@ import sys
import os import os
from datetime import datetime, timedelta from datetime import datetime, timedelta
from HTMLParser import HTMLParser from HTMLParser import HTMLParser
import six
sys.path.insert(0, os.path.dirname(__file__)) sys.path.insert(0, os.path.dirname(__file__))
import zulip_basecamp_config as config import zulip_basecamp_config as config
@ -170,7 +172,7 @@ def run_mirror():
if __name__ == "__main__": if __name__ == "__main__":
if not isinstance(config.RESUME_FILE, basestring): if not isinstance(config.RESUME_FILE, six.string_types):
sys.stderr("RESUME_FILE path not given; refusing to continue") sys.stderr("RESUME_FILE path not given; refusing to continue")
check_permissions() check_permissions()
if config.LOG_FILE: if config.LOG_FILE:

View file

@ -30,6 +30,7 @@
# python-dateutil is a dependency for this script. # python-dateutil is a dependency for this script.
from __future__ import print_function from __future__ import print_function
from __future__ import absolute_import
import requests import requests
import logging import logging
import time import time
@ -37,6 +38,7 @@ import sys
import os import os
from datetime import datetime, timedelta from datetime import datetime, timedelta
import six
try: try:
@ -315,7 +317,7 @@ def check_permissions():
sys.stderr(e) sys.stderr(e)
if __name__ == "__main__": if __name__ == "__main__":
if not isinstance(config.RESUME_FILE, basestring): if not isinstance(config.RESUME_FILE, six.string_types):
sys.stderr("RESUME_FILE path not given; refusing to continue") sys.stderr("RESUME_FILE path not given; refusing to continue")
check_permissions() check_permissions()
if config.LOG_FILE: if config.LOG_FILE: