Skip to content

Commit

Permalink
Makes query_local_distro.py Python3-compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
funkyfuture committed May 18, 2016
1 parent c66d80d commit 607be77
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,8 @@ def version_parts(self, best=False):
m = g.match(version_str)
if m:
major, minor, build_number = m.groups()
return (major, minor or '', build_number or '')
return ('', '', '')
return major, minor or '', build_number or ''
return '', '', ''

def major_version(self, best=False):
"""
Expand Down
31 changes: 16 additions & 15 deletions query_local_distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function
import distro

print 'os_release_info: {0}'.format(distro.os_release_info())
print 'lsb_release_info: {0}'.format(distro.lsb_release_info())
print 'distro_release_info: {0}'.format(distro.distro_release_info())
print 'id: {0}'.format(distro.id())
print 'name: {0}'.format(distro.name())
print 'name_pretty: {0}'.format(distro.name(True))
print 'version: {0}'.format(distro.version())
print 'version_pretty: {0}'.format(distro.version(True))
print 'like: {0}'.format(distro.like())
print 'codename: {0}'.format(distro.codename())
print 'linux_distribution_full: {0}'.format(distro.linux_distribution())
print 'linux_distribution: {0}'.format(distro.linux_distribution(False))
print 'major_version: {0}'.format(distro.major_version())
print 'minor_version: {0}'.format(distro.minor_version())
print 'build_number: {0}'.format(distro.build_number())
print('os_release_info: {0}'.format(distro.os_release_info()))
print('lsb_release_info: {0}'.format(distro.lsb_release_info()))
print('distro_release_info: {0}'.format(distro.distro_release_info()))
print('id: {0}'.format(distro.id()))
print('name: {0}'.format(distro.name()))
print('name_pretty: {0}'.format(distro.name(True)))
print('version: {0}'.format(distro.version()))
print('version_pretty: {0}'.format(distro.version(True)))
print('like: {0}'.format(distro.like()))
print('codename: {0}'.format(distro.codename()))
print('linux_distribution_full: {0}'.format(distro.linux_distribution()))
print('linux_distribution: {0}'.format(distro.linux_distribution(False)))
print('major_version: {0}'.format(distro.major_version()))
print('minor_version: {0}'.format(distro.minor_version()))
print('build_number: {0}'.format(distro.build_number()))

0 comments on commit 607be77

Please sign in to comment.