File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -253,10 +253,13 @@ def pack(args, releases):
253253
254254def check_version_cs (args ):
255255 # Checking version.cs
256- for line in open (path .join (SOURCE_DIRECTORY ,"version.cs" )):
257- res = re .match (r'^\s*\[assembly:\s+AssemblyVersion\("([0-9]+.[0-9]+.[0-9]+).([0-9]+)"\)\]\s*$' , line )
258- if res :
259- (v1 , v2 ) = res .groups ()
256+ with open (path .join (SOURCE_DIRECTORY ,"version.cs" )) as fp :
257+ match = re .search (r'\[assembly:\s+AssemblyVersion\("([0-9]+.[0-9]+.[0-9]+).([0-9]+)"\)\]' , fp .read ())
258+ if match :
259+ (v1 , v2 ) = match .groups ()
260+ else :
261+ flush ("The AssemblyVersion attribute in version.cs could not be found." )
262+ return False
260263 now = time .localtime ()
261264 year = now [0 ]
262265 month = now [1 ]
@@ -272,8 +275,7 @@ def check_version_cs(args):
272275 flush ("The version number in version.cs does not agree with the given version: " + hy + " vs. " + v1 )
273276 if (v2 != v3 or hy != v1 ):
274277 return False
275- fp .close ()
276- flush ("Creating release files for release \" " + args .version + "\" and internal version information: " + verline [qstart + 1 :qend ])
278+ flush ("Creating release files for release \" " + args .version + "\" and internal version information: " + v1 + "." + v2 )
277279 return True
278280
279281def parse_arguments ():
You can’t perform that action at this time.
0 commit comments