mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Use errno instead of hard-coding error 2
This commit is contained in:
parent
ff63f36932
commit
e6a4744f85
1 changed files with 2 additions and 1 deletions
|
@ -15,6 +15,7 @@
|
|||
# pylint: disable=unused-import,function-redefined,blacklisted-module,blacklisted-external-module
|
||||
|
||||
from __future__ import absolute_import
|
||||
import errno
|
||||
import fnmatch
|
||||
import sys
|
||||
|
||||
|
@ -203,7 +204,7 @@ def mock_open(mock=None, read_data='', match=None):
|
|||
for pat in match:
|
||||
if fnmatch.fnmatch(name, pat):
|
||||
return DEFAULT
|
||||
raise IOError(2, 'No such file or directory', name)
|
||||
raise IOError(errno.ENOENT, 'No such file or directory', name)
|
||||
|
||||
mock.side_effect = fopen_side_effect
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue