Skip to content

Commit 77652fe

Browse files
fix: enable the use of SQS and Google pub/sub on Windows
Avoid crashing on the fq import of fcntl
1 parent 7f4fae2 commit 77652fe

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

taskqueue/file_queue_api.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import fcntl
1+
try:
2+
import fcntl
3+
FILEQUEUE_SUPPORTED = True
4+
except ImportError:
5+
FILEQUEUE_SUPPORTED = False
6+
27
import functools
38
import itertools
49
import json
@@ -164,6 +169,12 @@ class FileQueueAPI(object):
164169
time is very long.
165170
"""
166171
def __init__(self, path):
172+
if not FILEQUEUE_SUPPORTED:
173+
raise NotImplementedError(
174+
"FileQueueAPI is only supported on unix based systems due to a "
175+
"dependency on fcntl interprocess locking."
176+
)
177+
167178
path = toabs(path)
168179
self.path = path
169180

0 commit comments

Comments
 (0)