Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3 compatibility fixes #3

Merged
merged 1 commit into from
Dec 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/test_webpack_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_errors_handled(self):
self.assertFalse('should not reach this')
except webpack_manifest.WebpackError as e:
self.assertEqual(
e.message,
e.args[0],
'Webpack errors: \n\nerror 1\n\nerror 2',
)

Expand All @@ -71,7 +71,7 @@ def test_status_handled(self):
self.assertFalse('should not reach this')
except webpack_manifest.WebpackError as e:
self.assertEqual(
e.message,
e.args[0],
'Webpack errors: \n\nerror 1\n\nerror 2',
)

Expand All @@ -87,7 +87,7 @@ def test_handles_timeouts_in_debug(self):
self.assertFalse('should not reach this')
except webpack_manifest.WebpackManifestBuildingStatusTimeout as e:
self.assertEqual(
e.message,
e.args[0],
'Timed out reading the webpack manifest at "{}"'.format(path),
)

Expand All @@ -101,6 +101,6 @@ def test_handles_unknown_statuses(self):
self.assertFalse('should not reach this')
except webpack_manifest.WebpackManifestStatusError as e:
self.assertEqual(
e.message,
e.args[0],
'Unknown webpack manifest status: "unknown status"',
)
2 changes: 1 addition & 1 deletion webpack_manifest/webpack_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def read(path, read_retry):
raise WebpackManifestFileError('Path "{}" is not an absolute path to a file'.format(path))

with open(path, 'r') as manifest_file:
content = manifest_file.read().encode('utf-8')
content = manifest_file.read()

# In certain conditions, the file's contents evaluate to an empty string, so
# we provide a hook to perform a single retry after a delay.
Expand Down