mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Tests: Don't hardcode errno constants
The values of ENOENT and ESRCH are architecture-dependent, so don't assume they're always 2 and 3.
This commit is contained in:
parent
59342bc10f
commit
23d63ccb44
4 changed files with 10 additions and 6 deletions
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import atexit
|
||||
import errno
|
||||
import json
|
||||
import os
|
||||
import shlex
|
||||
|
@ -274,7 +275,7 @@ class Task(object):
|
|||
try:
|
||||
shutil.rmtree(self.datadir)
|
||||
except OSError as e:
|
||||
if e.errno == 2:
|
||||
if e.errno == errno.ENOENT:
|
||||
# Directory no longer exists
|
||||
pass
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue