Define WindowsError on non-win32 platforms

Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
Joffrey F 2016-04-25 17:58:20 -07:00
parent 70a605acac
commit b7f9fc4b28
1 changed files with 7 additions and 0 deletions

View File

@ -12,6 +12,13 @@ from six.moves import input
import compose
# WindowsError is not defined on non-win32 platforms. Avoid runtime errors by
# defining it as OSError (its parent class) if missing.
try:
WindowsError
except NameError:
WindowsError = OSError
def yesno(prompt, default=None):
"""