Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more meaningfull exception

While I tried this module I wrote 

        key:"value"

Which is a meaningfull yaml string while a meaningful dict is ecxpected in the form

    key: "value"

I propose to raise an exception instead of an assert
  • Loading branch information...
commit 146e0f1a2f70d862c00ec6e77a4076d3953dc4a0 1 parent 8f2b857
julien tayon jul authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 flask_flatpages/__init__.py
4 flask_flatpages/__init__.py
View
@@ -86,7 +86,9 @@ def meta(self):
# yaml.safe_load('- 1\n- a') -> [1, 'a']
if not meta:
return {}
- assert isinstance(meta, dict)
+ if not isinstance(meta, dict):
+ raise Exception("Excpecting a valid dict in meta <%(_meta_yaml)s> for page at <%(path)s>" %
+ self.__dict__)
return meta
def __getitem__(self, name):
Please sign in to comment.
Something went wrong with that request. Please try again.