From 63f82034f143c75cf367b394ee05bd9e82eefe21 Mon Sep 17 00:00:00 2001 From: Doug Davis Date: Thu, 13 May 2021 13:46:56 -0400 Subject: [PATCH] catch a TypeError from os.path.samefile in case document.path or d.module_path are None --- pylsp/plugins/symbols.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pylsp/plugins/symbols.py b/pylsp/plugins/symbols.py index 48a8935f..87c4bd2c 100644 --- a/pylsp/plugins/symbols.py +++ b/pylsp/plugins/symbols.py @@ -40,7 +40,7 @@ def pylsp_document_symbols(config, document): continue try: docismodule = os.path.samefile(document.path, d.module_path) - except AttributeError: + except TypeError: # Python 2 on Windows has no .samefile, but then these are # strings for sure docismodule = document.path == d.module_path