Skip to content

Commit

Permalink
Another attempt at fixing PyPy's _reuse()/_drop() warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
wbond committed Sep 28, 2020
1 parent a2a564f commit 89d208f
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions certvalidator/_urllib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from __future__ import unicode_literals, division, absolute_import, print_function

import sys
import warnings

from asn1crypto import util

Expand All @@ -20,11 +19,6 @@

if sys.version_info < (3,):

warnings.filterwarnings(
'ignore',
"object has no _reuse/_drop methods",
)

class Request(_Request, object):
"""
Compatibility shim to make urrlib2.Request handle unicode
Expand Down Expand Up @@ -59,6 +53,21 @@ def add_header(self, name, value):
value.encode('iso-8859-1')
)

def _reuse(self):
"""
Makes PyPy happy
"""

pass

def _drop(self):
"""
Makes PyPy happy
"""

pass


else:

class Request(_Request):
Expand All @@ -76,3 +85,17 @@ def __init__(self, url):

super().__init__(url)
self.add_header('Host', self.host.split(":")[0])

def _reuse(self):
"""
Makes PyPy happy
"""

pass

def _drop(self):
"""
Makes PyPy happy
"""

pass

0 comments on commit 89d208f

Please sign in to comment.