From 5ef7a5a21386a316da26caa2eebc31cd4bcd34b6 Mon Sep 17 00:00:00 2001 From: Fenhl Date: Wed, 12 Aug 2015 10:51:20 +0000 Subject: [PATCH] /server/playerdata.json: suppress FileNotFoundError --- README.md | 2 +- api.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 71c1aa6..5661882 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This is version 1.17.1 of the API ([semver](http://semver.org/)). A list of avai Requirements ============ -* [Python](http://python.org/) 3.2 +* [Python](http://python.org/) 3.4 * [Pillow](http://pypi.python.org/pypi/Pillow) 2.5 (required for image-producing endpoints only) * [bottle](http://bottlepy.org/) 0.12 * [mcstatus](https://github.com/Dinnerbone/mcstatus) (required for `/server/status.json` only) diff --git a/api.py b/api.py index a998f36..3e3519f 100644 --- a/api.py +++ b/api.py @@ -10,6 +10,7 @@ import bottle import collections +import contextlib from datetime import datetime import io import json @@ -512,7 +513,8 @@ def api_player_data_all(): """Returns the player data of all whitelisted players, encoded as JSON""" nbtdicts = {} for user in playernames(): - nbtdata = api_player_data(user) + with contextlib.suppress(FileNotFoundError): + nbtdata = api_player_data(user) nbtdicts[user] = nbtdata return nbtdicts