Changes between Initial Version and Version 1 of Ticket #55150, comment 4


Ignore:
Timestamp:
Oct 23, 2017, 4:57:44 PM (7 years ago)
Author:
carlosfamilia (Carlos Familia)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #55150, comment 4

    initial v1  
    1414  import os
    1515  import sys
    16 - import ssl
     16+ import ssl
    1717  cmd = sys.modules["pymol.cmd"]
    1818  from pymol import _cmd
     
    2424              handle = finfo
    2525          elif '://' in finfo:
    26 -             context = ssl._create_unverified_context()
     26+             context = ssl._create_unverified_context()
    2727              req = urllib2.Request(finfo,
    2828                      headers={'User-Agent': 'PyMOL/' + _self.get_version()[0]})
    2929!             handle = urllib2.urlopen(req, context=context)
    30           else:
    31               handle = open(finfo, 'rb')
    32           contents = handle.read()
    33 --- 316,324 ----
    34           if not is_string(finfo):
    35               handle = finfo
    36           elif '://' in finfo:
    37               req = urllib2.Request(finfo,
    38                       headers={'User-Agent': 'PyMOL/' + _self.get_version()[0]})
    39 !             handle = urllib2.urlopen(req)
    4030          else:
    4131              handle = open(finfo, 'rb')
     
    5141 
    5242  import sys
    53 - import ssl
     43+ import ssl
    5444  if sys.version_info[0] > 2:
    5545      import urllib.request as urllib2
     
    6757 
    6858  def urlreadstr(url, encoding='iso-8859-1'):
    69 --- 31,39 ----
    70       not change that.
    71       '''
    72       from . import pref_get
    73 !
    74       timeout = pref_get('network_timeout', 10.0)
    75 !     return urllib2.urlopen(url, timeout=timeout)
    76  
    77  
    78   def urlreadstr(url, encoding='iso-8859-1'):
    7959}}}