File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 8
8
# in the COPYING file in the root directory of this source tree).
9
9
# #############################################################################
10
10
import re
11
- import sys
12
11
13
12
14
- def find_version (filepath ):
13
+ def find_version_tuple (filepath ):
15
14
version_file_data = None
16
15
with open (filepath ) as fd :
17
16
version_file_data = fd .read ()
@@ -24,17 +23,16 @@ def find_version(filepath):
24
23
version_match = regex .search (version_file_data )
25
24
if version_match :
26
25
return version_match .groups ()
27
- raise Exception ("Unable to find version string. " )
26
+ raise Exception ("Unable to find version string" )
28
27
29
28
30
29
def main ():
31
30
import argparse
32
31
parser = argparse .ArgumentParser (description = 'Print zstd version from lib/zstd.h' )
33
32
parser .add_argument ('file' , help = 'path to lib/zstd.h' )
34
33
args = parser .parse_args ()
35
- filepath = args .file
36
- version_tup = find_version (filepath )
37
- print ('.' .join (version_tup ))
34
+ version_tuple = find_version_tuple (args .file )
35
+ print ('.' .join (version_tuple ))
38
36
39
37
40
38
if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments