Skip to content

Commit e33ff9b

Browse files
committed
ch55xtool/ch55xtool.py: use __file__ as pathname base
then ch55xtool would work as well as python3 -m ch55xtool Issue: #25 Signed-off-by: Huang Rui <[email protected]>
1 parent b9979e4 commit e33ff9b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ch55xtool/ch55xtool.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ def __apply_option_list(opt_list, chip_ref, chip_cfgs, verbose=False):
466466
return cfgs_changed, result_d
467467

468468
def main():
469-
pathname = os.path.dirname(sys.argv[0])
469+
pathname = os.path.dirname(__file__) if '__file__' in globals() else os.path.dirname(sys.argv[0])
470470
fullpath = os.path.abspath(pathname)
471471

472472
parser = argparse.ArgumentParser(

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setuptools.setup(
44
name="ch55xtool",
5-
version="1.0.2",
5+
version="1.0.3",
66
author="Han Xiao",
77
author_email="[email protected]",
88
maintainer="https://github.com/MarsTechHAN/ch552tool/graphs/contributors",

0 commit comments

Comments
 (0)