Commit f24331d2 authored by Matthias Bernt's avatar Matthias Bernt
Browse files

fix edta metadata setting

fix for:

```
UnboundLocalError: local variable 'tpe' referenced before assignment
```

was discovered in the tests running here: https://github.com/galaxyproject/galaxy/pull/11043
parent 252ec1aa
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -526,6 +526,7 @@ class Edta(TabularData):
    def set_meta(self, dataset, **kwd):
        data_lines = 0
        delim = None
        tpe = None
        if dataset.has_data():
            with open(dataset.file_name) as dtafile:
                for idx, line in enumerate(dtafile):
@@ -550,7 +551,7 @@ class Edta(TabularData):
        dataset.metadata.data_lines = data_lines
        dataset.metadata.comment_lines = 0
        dataset.metadata.columns = len(dataset.metadata.column_names)
        if tpe > 0:
        if tpe in not None and tpe > 0:
            dataset.metadata.comment_lines += 1
            dataset.metadata.data_lines -= 1