Hi,

I just discovered this line in setup.py:

etc_root = os.sep.join(etc_path.split(os.sep)[:-1])

I've seen such constructs all over the code.*Please stop using such
constructs!* It's ugly, hard to understand, hard to maintain and
error-frown. For example this line does not honour alternative path
separators (os.path.altsep).

There as a very capable module os.path which handles path manipulation.
Please see <http://docs.python.org/library/os.path.html> for more
information.

The line above should be:

etc_root = os.path.dirname(etc_path)

Which more readable, easy to understand, speaks for itself, handles
alternate separators and is shorter, too.

-- 
Schönen Gruß - Regards
Hartmut Goebel
Dipl.-Informatiker (univ.), CISSP, CSSLP

Goebel Consult 
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de

Monatliche Kolumne: http://www.cissp-gefluester.de/
Goebel Consult mit Mitglied bei http://www.7-it.de

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Shinken-devel mailing list
Shinken-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shinken-devel

Reply via email to