
try:
    __version__ = 'v' + __import__('pkg_resources').get_distribution('chared').version
except:
    __version__ = 'r$Rev$'


try:
    __version__ = 'v' + __import__('pkg_resources').get_distribution('chared').version
except:
    import re
    __version__ = re.sub('.*(\d+).*', r'rev\1', '$Rev$')

Make sure the version is displayed as r<revision number> if the information about the package version is not available.
Make sure the version is displayed as r<revision number> if the information about the package version is not available.
  
  try:
      __version__ = 'v' + __import__('pkg_resources').get_distribution('chared').version
  except:
-     __version__ = 'r$Rev$'
+     import re
+     __version__ = re.sub('.*(\d+).*', r'rev\1', '$Rev$')
  
Make sure the version is displayed as r<revision number> if the information about the package version is not available.
## Code Before:

try:
    __version__ = 'v' + __import__('pkg_resources').get_distribution('chared').version
except:
    __version__ = 'r$Rev$'

## Instruction:
Make sure the version is displayed as r<revision number> if the information about the package version is not available.
## Code After:

try:
    __version__ = 'v' + __import__('pkg_resources').get_distribution('chared').version
except:
    import re
    __version__ = re.sub('.*(\d+).*', r'rev\1', '$Rev$')
