Skip to content

Commit e3e26ad

Browse files
committed
Merge pull request django-webpack#23 from matthiask/master
Less warnings
2 parents 4698f09 + 6a15a43 commit e3e26ad

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/app/tests/test_webpack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_simple_and_css_extract(self):
6161

6262
chunks = assets['chunks']
6363
self.assertIn('main', chunks)
64-
self.assertEquals(len(chunks), 1)
64+
self.assertEqual(len(chunks), 1)
6565

6666
main = chunks['main']
6767
self.assertEqual(main[0]['path'], os.path.join(settings.BASE_DIR, 'assets/bundles/main.js'))

webpack_loader/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def get_config(config_name):
4545

4646
def get_assets(config):
4747
try:
48-
return json.loads(open(config['STATS_FILE']).read())
48+
with open(config['STATS_FILE']) as f:
49+
return json.load(f)
4950
except IOError:
5051
raise IOError(
5152
'Error reading {}. Are you sure webpack has generated the file '

0 commit comments

Comments
 (0)