From 26f83ed001b7669d2cab979401ecd2d97e55de6d Mon Sep 17 00:00:00 2001
From: James Graham <J.A.Graham@soton.ac.uk>
Date: Fri, 28 Jul 2017 15:06:42 +0100
Subject: [PATCH] Remove support for Python 3.2, 3.3.  Add 3.6

---
 .travis.yml | 3 +--
 README.md   | 1 +
 pdb2lmp.py  | 6 ++----
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 9c685d1..1217059 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,6 @@
 language: python
 python:
-  - "3.2"
-  - "3.3"
   - "3.4"
   - "3.5"
+  - "3.6"
 script: py.test
diff --git a/README.md b/README.md
index ae1296d..c174a47 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,7 @@
 
 # pdb2lmp
 Convert PDB files to LAMMPS data and force field files.
+Requires Python 3.4 or greater.
 
 ## Aim
 This program uses a library of pre-defined molecule, atom, and bond types to convert PDB or GRO files into LAMMPS input DATA (topology) and FF (forcefield) files.  It was inspired by the GROMACS tool PDB2GMX as an attempt to make it easier to setup simulations using the [ELBA forcefield](https://github.com/orsim/elba-lammps).  It should however be more broadly applicable to molecular simulation in LAMMPS in general.
diff --git a/pdb2lmp.py b/pdb2lmp.py
index 179fd5f..76a748c 100755
--- a/pdb2lmp.py
+++ b/pdb2lmp.py
@@ -80,8 +80,7 @@ class PDB2LMP:
         def collect_type(values, counter, db_vals, typelist, stylelist, nextmol_name):
             for val in values:
                 try:
-                    regex = re.compile(val.ifnext)
-                    if regex.fullmatch(nextmol_name) is None:
+                    if re.fullmatch(val.ifnext, nextmol_name) is None:
                         continue
                 except AttributeError:
                     pass
@@ -198,8 +197,7 @@ class PDB2LMP:
                     atom_list = list(mol_db.atoms.keys())
                     for bond in getattr(mol_db, header.lower()):
                         try:
-                            regex = re.compile(bond.ifnext)
-                            if regex.fullmatch(nextmol_name) is None:
+                            if re.fullmatch(bond.ifnext, nextmol_name) is None:
                                 continue
                         except AttributeError:
                             pass
-- 
GitLab