Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

more meaningfull exception #6

Merged
merged 1 commit into from

2 participants

@jul

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

@jul jul 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
146e0f1
@SimonSapin SimonSapin merged commit 95cd9e8 into SimonSapin:master

1 check failed

Details default The Travis build failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 19, 2012
  1. @jul

    more meaningfull exception

    jul authored
    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
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 flask_flatpages/__init__.py
View
4 flask_flatpages/__init__.py
@@ -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):
Something went wrong with that request. Please try again.