Skip to content

Commit

Permalink
seba: impl removeprefix for older py
Browse files Browse the repository at this point in the history
  • Loading branch information
w23 committed Nov 14, 2022
1 parent fc76161 commit 57b37b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ref_vk/sebastian.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
shaders_path = os.path.abspath(args.path if args.path else '.')
print("shaders_path", shaders_path, file=sys.stderr)

def removeprefix(s, pre):
return s[len(pre):] if s.startswith(pre) else s

# remove comment lines and fix comma
def prepareJSON(path):
raw_json = buffer = result = ""
Expand Down Expand Up @@ -285,7 +288,7 @@ class Binding:

def __init__(self, node):
self.write = node.name.startswith('out_')
self.name = node.name.removeprefix('out_')
self.name = removeprefix(node.name, 'out_')
self.index = node.binding
self.descriptor_set = node.descriptor_set
self.stages = 0
Expand Down

0 comments on commit 57b37b8

Please sign in to comment.