from pkg_resources import get_distribution, DistributionNotFound
try:
    __version__ = get_distribution('kbcstorage').version
except DistributionNotFound:
    # package is not installed
    pass

from pkg_resources import get_distribution, DistributionNotFound
try:
    release = get_distribution('kbcstorage').version
    __version__ = '.'.join(release.split('.')[:2])
except DistributionNotFound:
    # package is not installed
    pass

Make package version string major.minor only
Make package version string major.minor only

  from pkg_resources import get_distribution, DistributionNotFound
  try:
-     __version__ = get_distribution('kbcstorage').version
+     release = get_distribution('kbcstorage').version
+     __version__ = '.'.join(release.split('.')[:2])
  except DistributionNotFound:
      # package is not installed
      pass
  
Make package version string major.minor only
## Code Before:
from pkg_resources import get_distribution, DistributionNotFound
try:
    __version__ = get_distribution('kbcstorage').version
except DistributionNotFound:
    # package is not installed
    pass

## Instruction:
Make package version string major.minor only
## Code After:
from pkg_resources import get_distribution, DistributionNotFound
try:
    release = get_distribution('kbcstorage').version
    __version__ = '.'.join(release.split('.')[:2])
except DistributionNotFound:
    # package is not installed
    pass
