HTD

Merge lp:~simon-d-bull/htd/31.fix_1062362 into lp:htd/3.1

Proposed by Simon Bull
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 30
Merged at revision: 30
Proposed branch: lp:~simon-d-bull/htd/31.fix_1062362
Merge into: lp:htd/3.1
Diff against target: 19 lines (+7/-3)
1 file modified
htd31/_base/file.py (+7/-3)
To merge this branch: bzr merge lp:~simon-d-bull/htd/31.fix_1062362
Reviewer Review Type Date Requested Status
Andrew Hayzen Approve
Review via email: mp+129417@code.launchpad.net

Description of the change

Added a meaningful error message when win32api isn't installed for windows.

To post a comment you must log in.
Revision history for this message
Andrew Hayzen (ahayzen) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'htd31/_base/file.py'
2--- htd31/_base/file.py 2012-08-07 20:35:39 +0000
3+++ htd31/_base/file.py 2012-10-12 12:51:33 +0000
4@@ -25,9 +25,13 @@
5 if os.name == "posix":
6 import fcntl
7 elif os.name == "nt":
8- import win32con
9- import win32file
10- import pywintypes
11+ try:
12+ import win32con
13+ import win32file
14+ import pywintypes
15+ except ImportError:
16+ raise ImportError("win32api needs to be installed, FileLock" \
17+ " unavailable")
18 else:
19 print("HTD Warning: Unknown operating system, FileLock unavailable.")
20

Subscribers

People subscribed via source and target branches

to all changes: