Remove the usage of pkg_resource
As pkg_resource was removed from python3.12, this patch uses os.path.dirname to replace the pkg_resource.resource_filename to support python3.12. Change-Id: I5b1a36ff508856e9ae9b0c771f2c0afe683850da
This commit is contained in:
parent
02a3c87559
commit
96ffedb596
@ -15,20 +15,15 @@
|
||||
"""Export paths"""
|
||||
|
||||
import os
|
||||
import pkg_resources
|
||||
import sys
|
||||
|
||||
|
||||
def get_path(var):
|
||||
if var == "lib":
|
||||
return os.path.abspath(
|
||||
pkg_resources.resource_filename(__name__, "lib"))
|
||||
elif var == "elements":
|
||||
return os.path.abspath(
|
||||
pkg_resources.resource_filename(__name__, "elements"))
|
||||
else:
|
||||
print("Unknown path request!")
|
||||
sys.exit(1)
|
||||
if var in ("lib", "elements"):
|
||||
return os.path.abspath(os.path.join(os.path.dirname(__file__), var))
|
||||
|
||||
print("Unknown path request!")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def show_path(var):
|
||||
|
Loading…
x
Reference in New Issue
Block a user