@@ -286,7 +286,7 @@ def outline(value):
286286
287287
288288##############################################################################
289- # # Border shorthands
289+ # Border shorthands
290290##############################################################################
291291def _parse_border_property_part (value , border_dict , direction = None ):
292292 """Parse border shorthand property part for known properties."""
@@ -472,7 +472,7 @@ def position(value):
472472 # <length> values are allowed.
473473 try :
474474 return Position (horizontal = units (values [0 ]))
475- except ValueError as error :
475+ except ValueError :
476476 if values [0 ] in ['left' , 'right' , 'center' ]:
477477 return Position (horizontal = values [0 ])
478478
@@ -485,7 +485,7 @@ def position(value):
485485 # Check first value
486486 try :
487487 horizontal = units (values [0 ])
488- except ValueError as error :
488+ except ValueError :
489489 if values [0 ] in ['left' , 'center' , 'right' ]:
490490 horizontal = values [0 ]
491491
@@ -495,7 +495,7 @@ def position(value):
495495 # Check second value
496496 try :
497497 vertical = units (values [1 ])
498- except ValueError as error :
498+ except ValueError :
499499 if values [1 ] in ['left' , 'center' , 'right' ]:
500500 horizontal = values [1 ]
501501
@@ -510,7 +510,7 @@ def position(value):
510510##############################################################################
511511# Background shorthand
512512##############################################################################
513- def _parse_background_property_part (value , outline_dict ):
513+ def _parse_background_property_part (value , background_dict ):
514514 """Parse background shorthand property part for known properties."""
515515 from .constants import ( # noqa
516516 BACKGROUND_ATTACHMENT_CHOICES , BACKGROUND_COLOR_CHOICES , BACKGROUND_IMAGE_CHOICES ,
@@ -527,11 +527,11 @@ def _parse_background_property_part(value, outline_dict):
527527 except (ValueError , ValidationError ):
528528 continue
529529
530- if property_name in border_dict :
530+ if property_name in background_dict :
531531 raise ValueError ('Invalid duplicated property!' )
532532
533- border_dict [property_name ] = value
534- return border_dict
533+ background_dict [property_name ] = value
534+ return background_dict
535535
536536 raise ValueError ('Background value "{value}" not valid!' .format (value = value ))
537537
0 commit comments