Changes between Initial Version and Version 1 of Ticket #55150, comment 4
- Timestamp:
- Oct 23, 2017, 4:57:44 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #55150, comment 4
initial v1 14 14 import os 15 15 import sys 16 -import ssl16 + import ssl 17 17 cmd = sys.modules["pymol.cmd"] 18 18 from pymol import _cmd … … 24 24 handle = finfo 25 25 elif '://' in finfo: 26 -context = ssl._create_unverified_context()26 + context = ssl._create_unverified_context() 27 27 req = urllib2.Request(finfo, 28 28 headers={'User-Agent': 'PyMOL/' + _self.get_version()[0]}) 29 29 ! 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 = finfo36 elif '://' in finfo:37 req = urllib2.Request(finfo,38 headers={'User-Agent': 'PyMOL/' + _self.get_version()[0]})39 ! handle = urllib2.urlopen(req)40 30 else: 41 31 handle = open(finfo, 'rb') … … 51 41 52 42 import sys 53 -import ssl43 + import ssl 54 44 if sys.version_info[0] > 2: 55 45 import urllib.request as urllib2 … … 67 57 68 58 def urlreadstr(url, encoding='iso-8859-1'): 69 --- 31,39 ----70 not change that.71 '''72 from . import pref_get73 !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'):79 59 }}}