X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=blobdiff_plain;f=.pdbrc;h=156bb126a6356b406db8e0fe5b1077ff238f24de;hp=f2ec6a5d7855d1351202c7f7f360846686aae942;hb=7c8abf339f6f103cf25d5f6c0d80bc6ae8ed75b6;hpb=920e9b2291149c2adbb89eaaf2644575aaaa06f9 diff --git a/.pdbrc b/.pdbrc index f2ec6a5..156bb12 100644 --- a/.pdbrc +++ b/.pdbrc @@ -10,7 +10,9 @@ import os import sys -x = execfile(os.path.expanduser("~/lib/python/pdbrc.py")) +x = sys.version_info[:2] == (2, 7) and execfile(os.path.expanduser("~/lib/python/pdbrc.py")) +# In Python 2.7 ``exec()`` raises SyntaxError. Ignore it, it's harmless here. +x = sys.version_info >= (3, 4) and exec(open(os.path.expanduser("~/lib/python/pdbrc.py"), 'rU').read()) # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498182 # replace the Pdb class's complete method with ours