Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
obs:server:fedora:2.9
gitpkg
_service:gitpkg:0003-Make-code-Python-3-compati...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:gitpkg:0003-Make-code-Python-3-compatible.patch of Package gitpkg
From 0c5fce0447bb3158532c80b83d035ce2f797f709 Mon Sep 17 00:00:00 2001 From: Oleg Girko <ol@infoserver.lv> Date: Thu, 30 Apr 2020 20:51:26 +0300 Subject: [PATCH] Make code Python 3 compatible. This change converts all print statements to syntax compatible with Python 3. Signed-off-by: Oleg Girko <ol@infoserver.lv> --- gp_mkpkg | 14 +++++++------- setup.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gp_mkpkg b/gp_mkpkg index e321c6c..d95442b 100755 --- a/gp_mkpkg +++ b/gp_mkpkg @@ -45,11 +45,11 @@ def git(*args, **kwargs): def log(msg): if args.verbose: - print(msg) + print(msg) def fail(msg, *args): """Report an error message and exit with failure""" - print >>sys.stderr, 'ERROR:', msg % args + sys.stderr.write('ERROR:' + msg % args + '\n') sys.exit(1) def checkout_packaging_branch(pkg, force): @@ -229,20 +229,20 @@ def apply_patches_to_spec(args, p, specfilename): if re.search(r'^%setup', line): if done_setup: - print "WARNING: multiple %setups found - please check patches are in the right place in spec" + print("WARNING: multiple %setups found - please check patches are in the right place in spec") else: done_setup = True if args.setup_src and not re.search(r'-n src(/s+.)?', line): - print "Adjusting %setup since git-pkg unpacks to src/ and there's no -n src in %setup" + print("Adjusting %setup since git-pkg unpacks to src/ and there's no -n src in %setup") spec_new.extend("# Adjusting %%setup since git-pkg unpacks to src/\n") spec_new.extend("# %s" % re.sub(r'%', '%%', line)) - print line.strip() + print(line.strip()) line,c = re.subn(r'-n\s*\S*', r'-n src', line) if c == 0: line = line.strip() + " -n src\n" - print "converted to" - print line.strip() + print("converted to") + print(line.strip()) # Now output modified or orig %setup and any patches spec_new.extend(line) spec_new.extend(p.spec_patches) diff --git a/setup.py b/setup.py index b32b25c..068ec4a 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ try: with open('version.py') as f: exec(f.read()) version=__version__ except IOError: - print 'WARNING: Cannot write version number file' + print('WARNING: Cannot write version number file') setup(name='gitpkg', version = version, -- 2.25.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor