From be91c02cf54e5cbee5144149aa6ba49343f34054 Mon Sep 17 00:00:00 2001
From: Pey Lian Lim <2090236+pllim@users.noreply.github.com>
Date: Thu, 22 Jul 2021 13:24:42 -0400
Subject: [PATCH] BUG: Fix wcs_autolink to work with GWCS

---
 glue/plugins/wcs_autolinking/wcs_autolinking.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/glue/plugins/wcs_autolinking/wcs_autolinking.py b/glue/plugins/wcs_autolinking/wcs_autolinking.py
index a820b1f9d..2f8e0880d 100644
--- a/glue/plugins/wcs_autolinking/wcs_autolinking.py
+++ b/glue/plugins/wcs_autolinking/wcs_autolinking.py
@@ -1,8 +1,7 @@
 import copy
 
-from astropy.wcs import WCS
 from astropy.wcs.utils import pixel_to_pixel
-from astropy.wcs.wcsapi import SlicedLowLevelWCS, HighLevelWCSWrapper
+from astropy.wcs.wcsapi import BaseHighLevelWCS, SlicedLowLevelWCS, HighLevelWCSWrapper
 from glue.config import autolinker, link_helper
 from glue.core.link_helpers import MultiLink
 
@@ -183,7 +182,7 @@ def wcs_autolink(data_collection):
 
     # Find subset of datasets with WCS coordinates
     wcs_datasets = [data for data in data_collection
-                    if hasattr(data, 'coords') and isinstance(data.coords, WCS)]
+                    if hasattr(data, 'coords') and isinstance(data.coords, BaseHighLevelWCS)]
 
     # Only continue if there are at least two such datasets
     if len(wcs_datasets) < 2: