divio / djangocms-rest-api

A REST API for django CMS
MIT License
51 stars 18 forks source link

Fix a couple minor issues with python3 #2

Closed narfman0 closed 8 years ago

narfman0 commented 8 years ago

The two list instances are where python3 has generators, but can't subscript children[0]. Creating a new list is minor performance overhead for python2, and necessary in python3 (without the complexity of building another generator around the current generator).

The if children... check avoids a NoneType iteration exception. I believe this is implicitly done in python2, but python3 throws the error. It is not expensive to make the check.

moridyn commented 8 years ago

Hi, thank you for your help. Changes from this request was already made, need to finish a part of code and will create a merge request as soon as possible.

moridyn commented 8 years ago

Would really appreciate comments and help with next part.

narfman0 commented 8 years ago

@moridyn sounds good, glad to help!