Skip to content

[fix] Checking for session attr#87

Open
re1ro wants to merge 1 commit intosyrusakbary:masterfrom
re1ro:master
Open

[fix] Checking for session attr#87
re1ro wants to merge 1 commit intosyrusakbary:masterfrom
re1ro:master

Conversation

@re1ro
Copy link
Contributor

@re1ro re1ro commented Jul 19, 2013

referencing to self.session raises an exception if session is not defined

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use if getattr(self, 'session', None):. It is cleaner and a bit faster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants