mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-04 03:52:56 +00:00
suppress FileNotFound exception instead of missing_ok=True because the latter is added in python 3.8 and we claim to support >3.6
This commit is contained in:
committed by
Dmitry Rodionov
parent
732d13fe06
commit
798df756de
@@ -14,7 +14,7 @@ import subprocess
|
||||
import time
|
||||
import filecmp
|
||||
|
||||
from contextlib import closing
|
||||
from contextlib import closing, suppress
|
||||
from pathlib import Path
|
||||
from dataclasses import dataclass
|
||||
|
||||
@@ -829,7 +829,8 @@ class WalAcceptor:
|
||||
def start(self) -> 'WalAcceptor':
|
||||
# create data directory if not exists
|
||||
self.data_dir.mkdir(parents=True, exist_ok=True)
|
||||
self.pidfile.unlink(missing_ok=True)
|
||||
with suppress(FileNotFoundError):
|
||||
self.pidfile.unlink()
|
||||
|
||||
cmd = [str(self.wa_bin_path)]
|
||||
cmd.extend(["-D", str(self.data_dir)])
|
||||
|
||||
Reference in New Issue
Block a user