Skip to content

Commit

Permalink
Replace deprecated pkg_resources usage
Browse files Browse the repository at this point in the history
Use importlib.metadata to check the jinja2 version

Signed-off-by: Cindy Liu <[email protected]>
  • Loading branch information
hcindyl committed Dec 15, 2023
1 parent 3d423db commit 3632540
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cdl_utils/capdl_linker.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@
from capdl.Object import register_object_sizes, Untyped
from capdl.Allocator import ASIDTableAllocator, BestFitAllocator
from capdl import ELF, lookup_architecture, TCB, valid_architectures
from importlib.metadata import version
from jinja2 import Environment, BaseLoader, FileSystemLoader
import sys
import argparse
import pickle
import logging
import os
import tempfile
import pkg_resources
import yaml
import six
pkg_resources.require("jinja2>=2.10")


CSPACE_TEMPLATE_FILE = os.path.join(os.path.dirname(__file__), "templates/cspace.template.c")
Expand Down Expand Up @@ -147,4 +146,8 @@ def main():


if __name__ == '__main__':
jinja2_version = version("jinja2")
if jinja2_version < "2.10":
sys.exit("Jinja2 should be >= 2.10")

sys.exit(main())

0 comments on commit 3632540

Please sign in to comment.