Skip to content

Commit

Permalink
Merge pull request #34 from offby1/master
Browse files Browse the repository at this point in the history
ExceptionPexpect.__init__: invoke super's init
  • Loading branch information
takluyver committed Jan 7, 2014
2 parents f477bc9 + a541386 commit 0b99c3a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions pexpect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class ExceptionPexpect(Exception):
'''

def __init__(self, value):
super(ExceptionPexpect, self).__init__(value)
self.value = value

def __str__(self):
Expand Down
14 changes: 14 additions & 0 deletions tests/test_pickling.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python
import pickle
import unittest

from pexpect import ExceptionPexpect

class PickleTest(unittest.TestCase):
def test_picking(self):
e = ExceptionPexpect('Oh noes!')
clone = pickle.loads(pickle.dumps(e))
self.assertEqual(e.value, clone.value)

if __name__ == '__main__':
unittest.main()

0 comments on commit 0b99c3a

Please sign in to comment.