Include portalocker in imaplibutil.py

This patch include the usage of portalocker for Windows environments,
because fcntl is not available.

This patch is related to issue #37, issue 1.
This commit is contained in:
Rodolfo García Peñas (kix) 2021-07-24 22:01:27 +02:00
parent be752838c8
commit a6fd6b1ded
1 changed files with 8 additions and 1 deletions

View File

@ -15,7 +15,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import datetime
import os
import fcntl
import time
import subprocess
import threading
@ -29,6 +28,14 @@ from offlineimap import OfflineImapError
from offlineimap.ui import getglobalui
from imaplib2 import IMAP4, IMAP4_SSL, InternalDate
try:
import portalocker
except:
try:
import fcntl
except:
pass # Ok if this fails, we can do without.
class UsefulIMAPMixIn:
def __getselectedfolder(self):