Skip to content

Commit 71dd44d

Browse files
committed
Fix str/bytes problems on Python 3
Fixes msiemens#25
1 parent 9982d6c commit 71dd44d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

PyGitUp/gitup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,9 @@ def log(self, branch, remote):
352352
prefix='PyGitUp.', suffix='.bat', delete=False
353353
) as bat_file:
354354
# Don't echo all commands
355-
bat_file.file.write('@echo off\n')
355+
bat_file.file.write(b'@echo off\n')
356356
# Run log_hook
357-
bat_file.file.write(log_hook)
357+
bat_file.file.write(log_hook.encode('utf-8'))
358358

359359
# Run bat_file
360360
state = subprocess.call(
@@ -391,7 +391,7 @@ def version_info(self):
391391

392392
try:
393393
# Get version information from the PyPI JSON API
394-
details = json.load(urlopen(PYPI_URL))
394+
details = json.loads(urlopen(PYPI_URL).read().decode('utf-8'))
395395
online_version = details['info']['version']
396396
except (HTTPError, URLError, ValueError):
397397
recent = True # To not disturb the user with HTTP/parsing errors

0 commit comments

Comments
 (0)