~myers-1/pyopenssl/npn

« back to all changes in this revision

Viewing changes to OpenSSL/test/util.py

  • Committer: Jean-Paul Calderone
  • Date: 2011-04-07 02:19:52 UTC
  • mfrom: (142.1.13 subjectAltName)
  • Revision ID: exarkun@divmod.com-20110407021952-c464twfn6f3j0uvf
Add more access to certificate extension data

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
from OpenSSL.crypto import Error, _exception_from_error_queue
17
17
 
18
 
 
19
 
try:
20
 
    bytes = bytes
21
 
except NameError:
 
18
if sys.version_info < (3, 0):
22
19
    def b(s):
23
20
        return s
24
21
    bytes = str
25
22
else:
26
23
    def b(s):
27
 
        return s.encode("ascii")
 
24
        return s.encode("charmap")
 
25
    bytes = bytes
28
26
 
29
27
 
30
28
class TestCase(TestCase):