Skip to content

Commit

Permalink
refactor: dumpLock
Browse files Browse the repository at this point in the history
  • Loading branch information
yzqzss committed Oct 12, 2024
1 parent 31f68b5 commit f28b36a
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions dokuWikiDumper/utils/dump_lock.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import sys
import importlib.util

class AlreadyRunningError(Exception):
Expand Down Expand Up @@ -40,16 +39,13 @@ def wrapper(*args, **kwargs):


class DumpLock_Fcntl():
fcntl = None
try:
import fcntl
except ModuleNotFoundError:
pass

def __init__(self, lock_dir):
if self.fcntl is None:
raise(ModuleNotFoundError("No module named 'fcntl'", name='fcntl'))

try:
import fcntl
except ModuleNotFoundError:
raise

self.fcntl = fcntl
self.lock_file = os.path.join(lock_dir, LOCK_FILENAME)
self.lock_file_fd = None

Expand Down

0 comments on commit f28b36a

Please sign in to comment.