Skip to content

Commit b0a18bb

Browse files
fix: Reference to removed variable (#2634)
Co-authored-by: Parva Shah <[email protected]> Co-authored-by: Fabio Madge <[email protected]>
1 parent 3ae2167 commit b0a18bb

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Scripts/package.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,13 @@ def pack(args, releases):
253253

254254
def 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

279281
def parse_arguments():

0 commit comments

Comments
 (0)