diff options
author | Trey Hunner <treyhunner@gmail.com> | 2012-03-31 11:59:07 -0700 |
---|---|---|
committer | Trey Hunner <treyhunner@gmail.com> | 2012-03-31 11:59:07 -0700 |
commit | c0a6a23c954176e73572ff54cd6031a48aed0507 (patch) | |
tree | c9041e4080a9880e8710042f58e73732adf71ca9 | |
parent | ea576162a54c6872cf2de87fb12a1f9f1c370814 (diff) | |
download | pycco-c0a6a23c954176e73572ff54cd6031a48aed0507.tar.gz |
Fix regular expression grouping (missing period)
-rw-r--r-- | pycco/main.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pycco/main.py b/pycco/main.py index 68d4823..105a7cb 100644 --- a/pycco/main.py +++ b/pycco/main.py @@ -324,8 +324,8 @@ for ext, l in languages.items(): def get_language(source): """Get the current language we're documenting, based on the extension.""" - m = re.match(r'.*\.(.+)', os.path.basename(source)) - if m and languages.has_key(m.group(1)): + m = re.match(r'.*(\..+)', os.path.basename(source)) + if m and m.group(1) in languages: return languages[m.group(1)] else: source = open(source, "r") |