Skip to content

Commit

Permalink
work around missing os.errno on py24
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Apr 20, 2014
1 parent 6950deb commit c784ec0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions slave/buildslave/test/unit/test_commands_fs.py
Expand Up @@ -23,6 +23,12 @@
from buildslave.test.util.command import CommandTestMixin
from twisted.python import runtime

# python-2.4 doesn't have os.errno
if hasattr(os, 'errno'):
errno = os.errno
else:
import errno


class TestRemoveDirectory(CommandTestMixin, unittest.TestCase):

Expand Down Expand Up @@ -167,7 +173,7 @@ def test_existing_file(self):
d = self.run_command()

def check(_):
self.assertIn({'rc': os.errno.EEXIST},
self.assertIn({'rc': errno.EEXIST},
self.get_updates(),
self.builder.show())
d.addCallback(check)
Expand All @@ -189,7 +195,7 @@ def test_non_existant(self):
d = self.run_command()

def check(_):
self.assertIn({'rc': os.errno.ENOENT},
self.assertIn({'rc': errno.ENOENT},
self.get_updates(),
self.builder.show())
d.addCallback(check)
Expand Down Expand Up @@ -296,7 +302,7 @@ def test_non_existant(self):
d = self.run_command()

def check(_):
self.assertIn({'rc': os.errno.ENOENT},
self.assertIn({'rc': errno.ENOENT},
self.get_updates(),
self.builder.show())
d.addCallback(check)
Expand Down

0 comments on commit c784ec0

Please sign in to comment.