from . import pq_cython # type: ignore
except Exception as e:
if not impl:
- logger.debug(f"C pq wrapper not available: %s", e)
+ logger.debug("C pq wrapper not available: %s", e)
else:
raise ImportError(
f"requested pq implementation '{impl}' not available"
from . import pq_ctypes
except Exception as e:
if not impl:
- logger.debug(f"ctypes pq wrapper not available: %s", e)
+ logger.debug("ctypes pq wrapper not available: %s", e)
else:
raise ImportError(
f"requested pq implementation '{impl}' not available"
if impl:
raise ImportError(f"requested pq impementation '{impl}' unknown")
else:
- raise ImportError(f"no pq wrapper available")
+ raise ImportError("no pq wrapper available")
import_from_libpq()
istart, iend = [
i
- for i, l in enumerate(lines)
- if re.match(r"\s*#\s*autogenerated:\s+(start|end)", l)
+ for i, line in enumerate(lines)
+ if re.match(r"\s*#\s*autogenerated:\s+(start|end)", line)
]
known = {
- l[4:].split("(", 1)[0] for l in lines[:istart] if l.startswith("def ")
+ line[4:].split("(", 1)[0]
+ for line in lines[:istart]
+ if line.startswith("def ")
}
signatures = []
)
new.extend(out.stdout.splitlines())
- new = [b" " * 4 + l if l else b"" for l in new] # indent
+ new = [b" " * 4 + line if line else b"" for line in new] # indent
istart, iend = [
i
- for i, l in enumerate(lines)
- if re.match(br"\s*#\s*autogenerated:\s+(start|end)", l)
+ for i, line in enumerate(lines)
+ if re.match(br"\s*#\s*autogenerated:\s+(start|end)", line)
]
lines[istart + 1 : iend] = new
try:
out = sp.run(
- ["pg_config", f"--includedir"], stdout=sp.PIPE, check=True
+ ["pg_config", "--includedir"], stdout=sp.PIPE, check=True
)
except Exception as e:
log.warn("cannot build C module: %s", e)