Skip to content

Commit f228367

Browse files
authored
Make ModuleNotFoundError ImportError instead (#9850)
1 parent 80b7c94 commit f228367

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

comfy/ldm/modules/attention.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
try:
2323
from sageattention import sageattn
2424
SAGE_ATTENTION_IS_AVAILABLE = True
25-
except ModuleNotFoundError as e:
25+
except ImportError as e:
2626
if model_management.sage_attention_enabled():
2727
if e.name == "sageattention":
2828
logging.error(f"\n\nTo use the `--use-sage-attention` feature, the `sageattention` package must be installed first.\ncommand:\n\t{sys.executable} -m pip install sageattention")
@@ -34,7 +34,7 @@
3434
try:
3535
from flash_attn import flash_attn_func
3636
FLASH_ATTENTION_IS_AVAILABLE = True
37-
except ModuleNotFoundError:
37+
except ImportError:
3838
if model_management.flash_attention_enabled():
3939
logging.error(f"\n\nTo use the `--use-flash-attention` feature, the `flash-attn` package must be installed first.\ncommand:\n\t{sys.executable} -m pip install flash-attn")
4040
exit(-1)

0 commit comments

Comments
 (0)