old_contents: # -*- coding: utf-8 -*-
  """Helpers for python 2/3 compatibility"""
  
  import sys
  
  PY3 = sys.version_info[0] == 3
  
  
  if PY3:
      import configparser as ConfigParser
  else:
      import ConfigParser
  
  
  if PY3:
      from urllib.parse import quote as url_quote
  else:
      from urllib import quote as url_quote
  
  
  if PY3:
      from urllib.parse import urlparse
  else:
      from urlparse import urlparse
  
  
  if PY3:
      imap = map
  else:
      from itertools import imap
  
  
  xrange = range if PY3 else xrange
  
new_contents: # -*- coding: utf-8 -*-
  """Helpers for python 2/3 compatibility"""
  
  import sys
  
  PY2 = sys.version_info[0] == 2
  
  
  if not PY2:
      import configparser as ConfigParser
  else:
      import ConfigParser
  
  
  if not PY2:
      from urllib.parse import quote as url_quote
  else:
      from urllib import quote as url_quote
  
  
  if not PY2:
      from urllib.parse import urlparse
  else:
      from urlparse import urlparse
  
  
  if not PY2:
      imap = map
  else:
      from itertools import imap
  
  
  xrange = range if not PY2 else xrange
  
subject: Use PY2 check instead of PY3 check.