File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 8585try :
8686 from nvidia import nvimgcodec
8787
88- nvimgcodec_version = tuple (int (x ) for x in nvimgcodec .__version__ .split ("." ))
88+ # Parse version string, extracting only numeric components to handle suffixes like "0.6.0rc1"
89+ try :
90+ import re
91+ version_parts = []
92+ for part in nvimgcodec .__version__ .split ("." ):
93+ # Extract leading digits from each version component
94+ match = re .match (r'^(\d+)' , part )
95+ if match :
96+ version_parts .append (int (match .group (1 )))
97+ else :
98+ break # Stop at first non-numeric component
99+ nvimgcodec_version = tuple (version_parts ) if version_parts else (0 ,)
100+ except (AttributeError , ValueError ):
101+ nvimgcodec_version = (0 ,)
89102except ImportError :
90103 nvimgcodec = None
91104
You can’t perform that action at this time.
0 commit comments