You've already forked macports-ports
mirror of
https://github.com/encounter/macports-ports.git
synced 2026-03-30 11:29:27 -07:00
37 lines
1.4 KiB
Diff
37 lines
1.4 KiB
Diff
Fix python 3 problems.
|
|
https://github.com/tomprince/txgithub/issues/13#issuecomment-333365646
|
|
--- txgithub/scripts/create_token.py.orig 2017-09-30 20:46:53.750550950 +0000
|
|
+++ txgithub/scripts/create_token.py
|
|
@@ -34,7 +34,7 @@ def run(reactor, *argv):
|
|
config = Options()
|
|
try:
|
|
config.parseOptions(argv[1:]) # When given no argument, parses sys.argv[1:]
|
|
- except usage.UsageError, errortext:
|
|
+ except usage.UsageError as errortext:
|
|
print('%s: %s' % (argv[0], errortext))
|
|
print('%s: Try --help for usage details.' % (argv[0]))
|
|
sys.exit(1)
|
|
--- txgithub/scripts/gist.py.orig 2017-09-30 20:47:17.806190554 +0000
|
|
+++ txgithub/scripts/gist.py
|
|
@@ -30,16 +30,16 @@ def postGist(reactor, token, files):
|
|
gistFiles['gistfile1'] = {"content": sys.stdin.read()}
|
|
|
|
response = yield api.gists.create(files=gistFiles)
|
|
- print response['html_url']
|
|
+ print(response['html_url'])
|
|
|
|
|
|
def run(reactor, *argv):
|
|
config = Options()
|
|
try:
|
|
config.parseOptions(argv[1:]) # When given no argument, parses sys.argv[1:]
|
|
- except usage.UsageError, errortext:
|
|
- print '%s: %s' % (argv[0], errortext)
|
|
- print '%s: Try --help for usage details.' % (argv[0])
|
|
+ except usage.UsageError as errortext:
|
|
+ print('%s: %s' % (argv[0], errortext))
|
|
+ print('%s: Try --help for usage details.' % (argv[0]))
|
|
sys.exit(1)
|
|
|
|
return postGist(reactor, **config)
|