Skip to content

Commit d93f22f

Browse files
doruchanjustinfx
authored andcommitted
Use try/except for str cases
1 parent 729f5f1 commit d93f22f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/fileseq/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,10 @@ def pad(number, width=0, decimal_places=None):
404404
# See _DeriveClipTimeString for formating of templateAssetPath
405405
# https://github.com/PixarAnimationStudios/USD/blob/release/pxr/usd/usd/clipSetDefinition.cpp
406406
if decimal_places == 0:
407-
if not isinstance(number, str):
407+
try:
408408
number = round(number)
409+
except TypeError:
410+
pass
409411
return futils.native_str(number).partition(".")[0].zfill(width)
410412

411413
# USD ultimately uses vsnprintf to format floats for templateAssetPath:

0 commit comments

Comments
 (0)