Skip to content

Commit

Permalink
Merge pull request #6522 from RRosio/update-version
Browse files Browse the repository at this point in the history
Using group method to match regex items
  • Loading branch information
echarles committed Aug 24, 2022
2 parents 71d48bf + dc0c8c4 commit a8d5ca7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions notebook/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Build up version_info tuple for backwards compatibility
pattern = r'(?P<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(?P<rest>.*)'
match = re.match(pattern, __version__)
parts = [int(match[part]) for part in ['major', 'minor', 'patch']]
if match['rest']:
parts.append(match['rest'])
parts = [int(match.group(part)) for part in ['major', 'minor', 'patch']]
if match.group('rest'):
parts.append(match.group('rest'))
version_info = tuple(parts)

0 comments on commit a8d5ca7

Please sign in to comment.