From 71e8dfb68c1eb6558a7f2739759078b958b63e0b Mon Sep 17 00:00:00 2001 From: buchanan Date: Thu, 31 Dec 2015 07:02:35 -0700 Subject: [PATCH] Map input to raw_input for 2.7 compatability change default https context to the more universal stdlib context --- pepper/cli.py | 5 +++++ pepper/libpepper.py | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pepper/cli.py b/pepper/cli.py index af7c857..3682a34 100644 --- a/pepper/cli.py +++ b/pepper/cli.py @@ -17,6 +17,11 @@ # Python 2 import ConfigParser +try: + input = raw_input +except NameError: + pass + import pepper try: diff --git a/pepper/libpepper.py b/pepper/libpepper.py index 1a336e9..e188ebf 100644 --- a/pepper/libpepper.py +++ b/pepper/libpepper.py @@ -8,11 +8,12 @@ import json import logging import os +import ssl try: - import ssl - ssl._create_default_https_context = ssl._create_unverified_context + ssl._create_default_https_context = ssl._create_stdlib_context except: pass + try: from urllib.request import HTTPHandler, Request, urlopen, \ install_opener, build_opener