From 8b002d44b08cc485ce95dd1326d99cbdb685e473 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ois=C3=ADn?= <denpashogai@gmail.com>
Date: Sat, 8 Jun 2024 16:34:10 +0100
Subject: [PATCH] Avoid AttributeError with PL_version_info in swipl <= 8.4.2
 (#154)

Avoid AttributeError with PL_version_info
---
 CONTRIBUTORS.txt | 1 +
 pyswip/core.py   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index 7ebb814..114f84c 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -29,3 +29,4 @@ Arvid Norlander
 David Cox
 Maximilian Peltzer
 Adi Harif
+Oisín Mac Fhearaí
diff --git a/pyswip/core.py b/pyswip/core.py
index 4c0fbae..3f867b7 100644
--- a/pyswip/core.py
+++ b/pyswip/core.py
@@ -594,7 +594,7 @@ def check_and_call(*args):
 # https://github.com/SWI-Prolog/swipl-devel/issues/900
 # https://github.com/SWI-Prolog/swipl-devel/issues/910
 try:
-    if _lib.PL_version_info != None:
+    if hasattr(_lib, "PL_version_info"):
         PL_version = _lib.PL_version_info # swi-prolog > 8.5.2
     else:
         PL_version = _lib.PL_version # swi-prolog <= 8.5.2